<script setup>
import {
  onAddToFavorites, onBackPress,
  onLoad,
  onReachBottom,
  onShareAppMessage,
  onShareTimeline,
  onShow, onUnload
} from "@dcloudio/uni-app";
import {onMounted, ref, watch, nextTick} from "vue";
import useZPaging from "z-paging/components/z-paging/js/hooks/useZPaging";
import {conUtils} from "../../utils/conUtils";
import {
  getHotShopAPI,
  getOfficialAccountInfoAPI,
  getRewardAPI,
  getServiceUrlAPI,
  getUserPlaceAPI
} from "../../services/common";
import {useCommonInfoStore} from "../../stores/modules/commonInfo";
import XtxEmpty from "../../components/XtxEmpty.vue";
import Sort from "./sort.vue";
import {useUserInfoStore} from "../../stores/modules/userInfo";
import {BaseImgUrl, BaseURL, deviceInfo} from "../../utils/lshttp";
import {
  dealReadAPI,
  getBannerListAPI, getAdCallBackAPI, getEventTrackingAPI,
  getHomeNavAPI,
  getNewShopListAPI,
  getNoticeListAPI, getPopupListAPI,
  placeUploadAPI, getNoticeAPI, getBannerNavAPI
} from "../../services";
import {getBindPidAPI, updateConfigAPI} from "../../services/me";
import Guanfan from "./guanfan.vue";
import XtxService from "../../components/XtxService.vue";
import {toMiniAppRedPage, toPageUtils} from "../../utils/utils";
import {gotoAppPermissionSetting, requestAndroidPermission} from "../../js_sdk/wa-permission/permission";
import ShopItemGF from "./shopItemGF.vue";
import checkVersion from "../lq-upgrade/checkVersion";
import LszbgDowload from "../../components/LszbgDowload.vue";
import Lszbg_challenge from "../challenge/lszbg_challenge.vue";
import ShopItem from "./shopItem.vue";
import Pzzq from "./pzzq.vue";
import CacheImage from "../../components/CacheImage.vue";
import Gf_model from "./gf_model.vue";
import Pmeg from "./pmeg.vue";
import {getNewTimeV2, timestampToDate} from "../../utils/date";
import {categoryAPI} from "../../services/search";
import ShopListBannerItem from "./shopListBannerItem.vue";
import {getOrderGFListsAPI} from "../../services/order";
import LszbgCountDown from "../../components/LszbgCountDown.vue";
import LszbgUniCountDown from "../../components/LszbgUniCountDown.vue";
import XtxDragButton from "../../components/XtxDragButton.vue";

const commonInfoStore = useCommonInfoStore() // 使用commonInfoStore状态管理器
const useUser = useUserInfoStore() // 使用userInfoStore状态管理器
const reward = ref() // 声明一个名为reward的ref，用于存储奖励信息
const isShowPaging = ref(false) // 声明一个名为isShowPaging的ref，用于存储是否显示分页的标志
const isHaveLocation = ref(false) // 声明一个名为isHaveLocation的ref，用于存储是否有定位的标志
const isShowNotice = ref(false) // 声明一个名为isShowNotice的ref，用于存储是否显示通知的标志
const isShowRedBag = ref(false) // 声明一个名为isShowRedBag的ref，用于存储是否显示红包的标志
const paging = ref(null) // 声明一个名为paging的ref，用于存储分页对象
useZPaging(paging) // 使用ZPaging状态管理器管理paging
const pageNo = ref(null) // 声明一个名为pageNo的ref，用于存储当前页码
const dataList = ref([]) // 声明一个名为dataList的ref，用于存储数据列表
const menuList = ref([]) // 声明一个名为menuList的ref，用于存储菜单列表
const bannerData = ref([]) // 声明一个名为bannerData的ref，用于存储横幅数据
const address = ref({latitude: '', longitude: '', recommend: '', city: '', district: ''}) // 声明一个名为address的ref，用于存储地址信息
const city = ref('') // 声明一个名为city的ref，用于存储城市信息
const district = ref('') // 声明一个名为district的ref，用于存储区域信息
const currentMenuIndex = ref(0) // 声明一个名为currentMenuIndex的ref，用于存储当前菜单索引
const shopType = ref(0) // 声明一个名为shopType的ref，用于存储店铺类型
const noticeData = ref([]) // 声明一个名为noticeData的ref，用于存储通知数据
const message = ref("点外卖用领食周边购，每餐只要0-5元") // 声明一个名为message的ref，用于存储消息文本
const isNoLocal = ref(false) // 声明一个名为isNoLocal的ref，用于存储是否没有定位的标志
const getAddressFailed = ref(true)
const showAdd = ref(true)
// 定义是否显示绑定信息的变量，默认为false
const bangdingShow = ref(false)

// 定义电话号码的变量，默认为空字符串
const tel = ref('')

// logo图片滚动
const logoImg = ref([
    {
      id: 1,
      img: '/home/home_top_img01.png',
    },
    {
      id: 2,
      img: '/home/home_top_img02.png',
    },
])

// 定义是否没有电话号码的变量，默认为false
const noTel = ref(false)

// 定义是否没有数据的变量，默认为false
const isNodata = ref(false)

// 定义排序类型的变量，默认为0
const sortType = ref(0)
// 定义只看可抢变量，默认为0
const is_orderable = ref(0)

// 定义旧的type4值的变量，默认为0
const oldType4 = ref(0)

// 定义type1的变量，默认为1
const type1 = ref(1)

// 定义type2的变量，默认为0
const type2 = ref(0)

// 定义type3的变量，默认为0
const type3 = ref(0)

// 定义type4的变量，默认为0
const type4 = ref(0)

// 定义is_new_shop是否是新店铺的变量，默认为0
const is_new_shop = ref(0)
// 定义isHot是否是品质商家
const isHot = ref(0)

// 定义页面PV ID的变量，默认为空字符串
const pagePvId = ref('')

// 创建一个选择器查询对象，用于后续的DOM操作
const query = uni.createSelectorQuery();

// 获取安全区域高度getSystemInfoSync
const safeAreaHeight = uni.getSystemInfoSync().safeAreaInsets.top

// 定义bar内容的高度，初始值为0，注释中的44 + 32可能是其计算值的一部分
const barContent = ref(0)//44 + 32
// 当前位置高度
const addresHeight = ref(0)
// 定义topContent内容的高度，初始值为0，注释通过获取topContent的高度来改变筛选模块的背景
const topContentHeight = ref(0)//44 + 32

// 定义排序状态的变量，默认为0
const sort = ref(0)

// 定义更新数据的变量，默认未初始化
const updateData = ref()

// 定义时间的变量，默认未初始化
const time = ref()

// 定义网络状态的变量，默认为true表示网络可用
const isNetwork = ref(true)

// 定义获取网络状态的计数，默认为0
const getNetCount = ref(0)

// 获取屏幕高度并减去状态栏高度，作为屏幕实际可用高度
let screenHeight = uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().statusBarHeight

// 获取系统消息列表
const msgList = ref([])

// 定义新用户绑定的变量，默认新用户
const newUser = ref('新用户')
// 获取霸王餐分类数据变量
const overlordMealClassList = ref([])

// 获取小程序右侧胶囊宽度
const menuRightWidth = ref()
onShow(async () => {
  console.log("screenHeight==", screenHeight)
  // 清空系统消息列表
  msgList.value = []
  const res = await getNoticeListAPI()
  res.result.forEach(item => {
    if (item.is_read === 0){
      msgList.value.push(item)
    }
  })
  // msgList.value = res.result
  // console.log('系统消息列表=',res.result)
  // await getPopup()

  // #ifdef H5
  paging?.value?.updateFixedLayout()
  // #endif
  if (useUser.isLoginBool()) {
    await useUser.getUserInfo()
    // paging?.value?.refresh();
    if (commonInfoStore.parentId && !useUser.userInfo.parent_id) {
      await getBindPidAPI(commonInfoStore.parentId)
    }
    tel.value = useUser.userInfo?.mt_phone
    if (!useUser.userInfo.username) {
      noTel.value = true
      return
    }
    if (!tel.value && useUser.userInfo?.future_tel) {
      bangdingShow.value = true
      return
    }
    if (noTel.value) {
      noTel.value = false
      paging.value?.reload();
    }
    // 获取订单列表
    getorderListFun()
  }
  // 获取小程序右侧胶囊宽度
  /* #ifdef MP */
  menuRightWidth.value = uni.getMenuButtonBoundingClientRect().left
  console.log('安全区高度=', safeAreaHeight)
  /* #endif */
  // 判断是否是新用户
  if (useUser.isNewUser || !useUser.isLoginBool()){
    newUser.value = '新用户'
    isShowNewUser.value = commonInfoStore.getShowExecuteEvent()
    console.log('新用户=', newUser.value, commonInfoStore.getShowExecuteEvent())
  } else {
    newUser.value = '老用户'
    isShowNewUser.value = commonInfoStore.getShowExecuteEvent()
    console.log('老用户=', newUser.value, commonInfoStore.getShowExecuteEvent())
  }

})
// 监听数据变化
watch(newUser, async (newValue, oldValue) => {
  console.log('新用户是否变化=',newValue)
  // 判断是否是新用户
  /* if (useUser.isNewUser || !useUser.isLoginBool()){
    newUser.value = '新用户'
    isShowNewUser.value = commonInfoStore.getShowExecuteEvent()
    console.log('新用户=', newUser.value, commonInfoStore.getShowExecuteEvent())
  } else {
    newUser.value = '老用户'
    isShowNewUser.value = commonInfoStore.getShowExecuteEvent()
    console.log('老用户=', newUser.value, commonInfoStore.getShowExecuteEvent())
  } */
  // 用户登录前都是新用户，获取新用户banner，登录后页面刷新获取用户是否是新用户banner
  await getBanner()
  // 品质专区横幅广告banner
  await getPosterBanner()
})
// 监听跳转
const handleLaunch = (tab) => {
  isShowRedBag.value = false
}
// 监听错误
const handleError = (tab) => {
}
const checkUpdate = () => {
  let name = updateData.value.version;  //新版本名称
  let code = updateData.value.code; //新版本号（数字）
  let content = updateData.value.content;  //更新内容
  let app_url = updateData.value.url;  //wgt下载链接，（演示请换成真正在下载链接）
  let wgt_url = updateData.value.wgt_url;  //app下载链接，（演示请换成真正在下载链接）
  let forceUpdate = updateData.value.forceUpdate !== 0;//是否强制更新
  let hot_version = updateData.value.hot_version;//允许热更新的范围
  //检查是否需要更新
  checkVersion({
    name,//最新版本名称
    code,//最新版本号
    content,//更新内容
    app_url,//下载链接
    wgt_url,//下载链接
    forceUpdate,//是否强制升级
    hot_version,//是否整包更新
  })
}
// 获取当前运行平台的信息
const platform = uni.getSystemInfoSync().platform;
// 获取当前设备的ID
const deviceId = uni.getSystemInfoSync().deviceId;
// 定义一个响应式参数
const param = ref()
// 定义一个响应式变量，用于控制更新提示的显示
const showUpdate = ref(false)


onLoad(async (options) => {
   console.log("onLoad--options", options)

  // 获取霸王餐分类数据
  const resCate = await categoryAPI()
  console.log('霸王餐分类数据=', resCate.result)
  overlordMealClassList.value = resCate.result

  // 不用判断用户登录，都要弹窗分享功能
  // isShowPopup.value = commonInfoStore.getShowRed()
  console.log('isShowPopup=', isShowPopup.value)
  // #ifdef APP-PLUS
  if (platform === 'ios') {
    isNetwork.value = false
  }
  // #endif
  await uni.setTabBarStyle({
    color: '#000000',
    selectedColor: '#FC4D16',
    backgroundColor: '#ffffff',
    borderStyle: 'white',
  })

  param.value = options
  // #ifdef H5
  getLocation()
  // #endif
  // 根据传入的options设置父用户ID和场景信息，并启动网络状态检测定时器
  if (options?.parent_id) {
    commonInfoStore.setParentUid(options.parent_id)
  }
  // 获取外部平台分享链接ID
  if (options?.invite_link_id){
    commonInfoStore.setInviteLinkId(options.invite_link_id)
  }
  console.log('第三方平台ID=',commonInfoStore.invite_link_id)
  // 保存渠道来源
  if (options?.source) {
    commonInfoStore.setSource(options.source)
  }
  if (options?.scene) {
    const scene = decodeURIComponent(options.scene)
    commonInfoStore.setParentUid(scene)
  }
  if (options?.reseller_id) {
    commonInfoStore.setParentRid(options.reseller_id)
  }
  // 广告平台接收callback返回值
  const callback = ref('15285037895')
  if (options?.callback){
    callback.value = decodeURIComponent(options.callback)
    commonInfoStore.setCallback(callback.value)
    await getAdCallBackAPI({
      callback: callback.value,
      eventType: 'index'
    })
  }
  time.value = setInterval(() => {
    uni.getNetworkType({
      success: res => {

        if (res.networkType !== "none" || !bannerData.value) {
          clearInterval(time.value)
          isNetwork.value = true
          getMenuListAndBanner()
          getCommonInfo()
          // 获取权限
          // #ifdef APP-PLUS || MP
          getLocationQX()
          // #endif
          if (isPermission.value || uni.getStorageSync('locAuthorization') === 1) {

            // 判断用户是否登录
            if (useUser.isLoginBool()) {
              // #ifdef MP-WEIXIN
              // isShowRedBag.value = commonInfoStore.getShowRed()
              // #endif
              // isShowBigActivity.value = commonInfoStore.getShowRed()
            } else {
              console.log('获取网络类型=', res.networkType)
            }
            // useUser.isLogin()
          }
          if (useUser.isLoginBool()) {
            placeUploadAPI()
            if (commonInfoStore.parentId && !useUser.userInfo.parent_id) {
              getBindPidAPI(commonInfoStore.parentId)
            }
          }
          getUpdateInfo()
        } else {
          getNetCount.value = getNetCount.value + 1
          isNetwork.value = false
        }
      }
    });
  }, 380);
  await getPopup()
  // 页面加载获取一次顶部位置的高度
  await getBarHeight()
  // 获取topContent的高度
  topContent()
  // 获取banner
  await getBanner()
  // 品质专区横幅广告banner
  await getPosterBanner()

})
onUnload(() => {
  clearInterval(time.value)
})
const openSettings = () => {
  var url = 'app-settings:';
  // 判断运行环境是否为iOS
  if (plus.os.name.toLowerCase() === 'ios') {
    // 使用plus.runtime.openURL打开系统设置页面
    plus.runtime.openURL(url, function (error) {
      console.error('打开系统设置失败: ' + error.message);
    });
  } else {
    console.log('非iOS设备，不支持打开系统设置。');
  }
}

const tpzc = () => {
  uni.navigateTo({
    url: '/pages_gold/bonus'
  })
}

const getUpdateInfo = async () => {
  const {result} = await updateConfigAPI()
  commonInfoStore.setApplet_version(result.applet_version_config)
  if (result.android_version_config.content.search("个人中心更新") !== -1) {
    showUpdate.value = true
  }
  if (result.ios_version_config.content.search("签到页面更新") !== -1) {
    showUpdate.value = true
  }
  // #ifdef APP-PLUS
  if (platform === 'ios') {
    updateData.value = result.ios_version_config
    plus.runtime.getProperty(plus.runtime.appid, async (appInfo) => {
      useUser.setIsOpenWXLogin(updateData.value.audit !== parseInt(appInfo.versionCode))
    })
  } else {
    updateData.value = result.android_version_config
    useUser.setIsOpenWXLogin(true)
  }
  // #endif
}
onShow(() => {
  commonInfoStore.setWxShareMessage("message", message.value, useUser.userInfo?.id);
})

// 转发到聊天界面
onShareAppMessage(() => {
  return commonInfoStore.setWxShareMessage("message", message.value, useUser.userInfo?.id);
})

// 转发到朋友圈
onShareTimeline(() => {
  return commonInfoStore.setWxShareMessage("friend", message.value, useUser.userInfo?.id);
})
// 添加到收藏
onAddToFavorites(() => {
  return commonInfoStore.setWxShareMessage("favorite", message.value, useUser.userInfo?.id);
})
// 获取位置及位置权限
const getLocationQX = () => {
  // #ifdef MP || H5
  isPermission.value = true
  commonInfoStore.getUserLocation(() => {
    isNoLocal.value = false
    getLocation()
  }, () => {
    isNoLocal.value = true
    chooseLoc()
  })
  // #endif
  // #ifdef APP-PLUS
  console.log("111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")
  if (!isPermission.value) {
    getPermission(1)
  }
  // #endif
}
// 获取公共信息
const getCommonInfo = () => {
  getOfficialAccountInfo()
  getServiceUrl()
  getReward()
}
// 获取菜单及banner
const getMenuListAndBanner = () => {
  getMenuLis()
  getNotice()
  getPZShop()
}
// 获取品质专区数据
const pzList = ref([])
const pzzqHeight = ref(0)
const getPZShop = async () => {
  if (!address.value?.latitude) {
    return
  }
  const res = await getHotShopAPI({
    lat: address.value?.latitude,
    lng: address.value?.longitude,
    round: 1
  })

  if (res?.result && res?.result.length > 0) {
    pzList.value = res.result
    pzzqHeight.value = 140 + (isPZZQ.value ? 60 : 0)
    // 一直循环5秒获取随机排序方法
    setInterval(() => {
      pzList.value = shuffle(pzList.value)
    }, 5000)
    console.log('品质专区=', pzList.value)
  }
  /* else {
    pzList.value = [{logo: 'https://lsz.lszbg.com/imgs/images/logo_login.png', name: '品质店铺'}]
  } */

}
// 品质店铺数据随机排序
const shuffle = (array) => {
  for (let i = array.length - 1; i > 0; i--) {
    let j = Math.floor(Math.random() * (i + 1));
    [array[i], array[j]] = [array[j], array[i]];
  }
  return array;
}

const getMenuLis = async () => {
  const menu = await getHomeNavAPI()
  menuList.value = menu.result
  console.log('导航菜单=',menuList.value)
}
// 获取banner数据
const getBanner = async () => {
  bannerData.value = []
  const banner = await getBannerListAPI({
    show_user_type: newUser.value == '新用户' ? 1 : 2,
  })
  /* banner.result.forEach((item) => {
    if (item.title === newUser.value){
      bannerData.value.push(item)
    }
  }) */
  bannerData.value = banner.result
  console.log('banner数据=',bannerData.value)
}
// 获取横幅广告posterBanner
const posterBanner = ref([])
const newUserVal = ref()
const getPosterBanner = async () => {
  posterBanner.value = []
  const res = await getBannerNavAPI(6)
  res.result.forEach((item) => {
    if (!useUser.isLoginBool()){
      if (item.is_new === 1){
        posterBanner.value.push(item)
      }
    } else {
      if (item.is_new === 1 && useUser.isNewUser == true){
        posterBanner.value.push(item)
      }else if(item.is_new === 0 && useUser.isNewUser == false){
        posterBanner.value.push(item)
      }
    }
  })
  // posterBanner.value = res.result
  console.log("banner===", res.result, posterBanner.value)
}
const noticesStr = ref([])
const isHaveRead = ref(false)
const getNotice = async () => {
  const notice = await getNoticeListAPI()
  noticeData.value = notice.result
  showNotice.value = []
  noticeData.value.forEach((item) => {
    noticesStr.value.push(item.title)
  })
  currentNoticeIndex.value = 0
  for (let i = 0; i < noticeData.value.length; i++) {
    if (noticeData.value[i].is_read === 0 && i < 3) {
      showNotice.value.push(noticeData.value[i])
      if (isShowNotice.value === false) {
        noticeItem.value = noticeData.value[i].contents
        noticeItemId.value = noticeData.value[i]
        isShowNotice.value = true
      }
    } else if (noticeData.value[i].is_read === 0) {
      isHaveRead.value = true
    }
  }
}
const getOfficialAccountInfo = async () => {
  const officialAccountInfo = await getOfficialAccountInfoAPI()
  commonInfoStore.setInfo1(officialAccountInfo)
}
const getServiceUrl = async () => {
  const serviceUrl = await getServiceUrlAPI()
  commonInfoStore.setInfo2(serviceUrl.result)
}
// 获取美团、饿了么、京东跳转页面路径
const getReward = async () => {
  const rewardObj = await getRewardAPI()
  console.log("获取美团、饿了么、京东跳转页面路径=", rewardObj.result)

  reward.value = rewardObj.result
  commonInfoStore.setInfo3(rewardObj.result)
}

const getLocation = () => {
  let highLocation = {}
  // #ifdef APP-PLUS
  //安卓打包开启 IOS打包注释掉  因为IOS上获取很慢位置问题
  if (platform === "android") {
    highLocation = {
      highAccuracyExpireTime: "3000",
      isHighAccuracy: true,
    }
  }
  // #endif
  // #ifdef H5
  isPermission.value = true
  highLocation = {
    accuracy: 'high',
    altitude: true,
  }
  // #endif
  uni.getLocation({
    type: 'gcj02',
    ...highLocation,
    success: async function (localRes) {
      // await uni.showToast({title: '定位成功'})
      // 贵阳坐标
      let position = {
        lat: 26.557808430989585,
        lon: 106.66976399739583
      }
      // address.value.latitude = localRes.latitude.toString()
      address.value.latitude = position.lat
      // address.value.longitude = localRes.longitude.toString()
      address.value.longitude = position.lon
      isShowPaging.value = true
      isHaveLocation.value = true
      getAddressFailed.value = false
      //经纬度逆解析
      const res = await getUserPlaceAPI(address.value.latitude, address.value.longitude)
      console.log('逆解析数据=', res.result)
      commonInfoStore.setAddressDel(res.result)
      city.value = res.result.city
      district.value = res.result.district
      address.value.city = city.value
      address.value.recommend = res.result.recommend
      address.value.district = res.result.district
      commonInfoStore.setAddress(address.value)
      paging?.value?.reload();
      uni.setStorageSync('locAuthorization', 1)
      isPermission.value = true
      getAddressFailed.value = true
      await getPZShop()
    }, fail(e) {
      isNoLocal.value = true
      // #ifdef APP-PLUS || H5
      getLocationQX()
      // #endif
    }
  });
}
// 选择地址
const chooseLoc = async () => {
  if (!city.value) {
    getLocationQX()
    return
  }
  // #ifdef APP-PLUS || H5
  await uni.navigateTo({
    url: '/pages/search/search_location?lat='
        + address.value.latitude + '&log='
        + address.value.longitude + '&keyWord='
        + address.value.recommend + "&cityName="
        + city.value,
    events: {
      // 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
      acceptDataFromOpenedPage: function (addressData) {
        console.log("addressData", addressData)
        setLocation(addressData.data)
        getPZShop()
      }
    }
  })
  // #endif
  // #ifdef MP
  const res = await uni.chooseLocation() //{latitude: address.value.latitude, longitude: address.value.longitude}
  if (!res.name) {
    await uni.showToast({title: "请选择地址", icon: "none", duration: 3000})
    return
  }
  conUtils("city.value", city.value)
  conUtils("res.address.indexOf(city.value)", res.address.indexOf(city.value))

  const addressRes = await getUserPlaceAPI(res.latitude, res.longitude)
  conUtils("getUserPlaceAPI", addressRes)
  console.log('解析的地址=', addressRes)

  // TODO 打包时候开启
  if (city.value && addressRes.result.city !== city.value) {
    await uni.showToast({title: "不能选择其他城市", icon: "none", duration: 3000})
    return
  }
  city.value = addressRes.result.city
  district.value = addressRes.result.district
  address.value.city = city.value
  address.value.district = district.value
  commonInfoStore.setAddressDel(addressRes.result)
  commonInfoStore.setAddress(address.value)
  setLocation(res)
  await getPZShop()
  // #endif
}
const setLocation = (res) => {
  console.log('设置地址=', res)
  address.value.recommend = res.name
  // address.value.district = res.district
  address.value.latitude = res.latitude
  address.value.longitude = res.longitude
  if (res?.city) {
    address.value.city = res.city
    city.value = res.city
  }
  commonInfoStore.setAddress(address.value)
  if (!res.district){
    paging.value?.reload();
  }

}

const gridChange = (e) => {
  currentMenuIndex.value = e.detail.current;
}
/*查看公告弹窗*/
const chakanNoti = () => {
  isShowNotice.value = true
}
const noticeItem = ref("")
const noticeItemId = ref()
const lockNotice = (index) => {
  console.log("noticeData.value[index].contents", noticeData.value[index].contents)
  noticeItem.value = noticeData.value[index].contents
  noticeItemId.value = noticeData.value[index]
  isShowNotice.value = true
}
// 消息通知
const toMsg = () => {
  uni.navigateTo({
    url: "/pages/index/message"
  })
}
// 签到
const singIn = () => {
  // 跳转内置页面
  if (useUser.isLogin()) {
    uni.navigateTo({
      url: "/pages/signin/signin"
    })
  }
}
// banner 点击事件
const onToPage = async (item) => {
  // 触发时间
  let trigger_time = timestampToDate(new Date().getTime())
  // 调用埋点事件
  await getEventTrackingFun('bannerClick', item, trigger_time)

  console.log("onToPage", "onToPage")
  await toPageUtils(item)
}
const toRedPage = (item) => {
  console.log("toRedPage", item)
  toMiniAppRedPage(item)
}
const toSearch = () => {
  uni.navigateTo({
    url: "/pages/search/search?latitude="
        + address.value?.latitude + "&longitude="
        + address.value?.longitude + "&city=" + city.value + "&addressStr="
        + address.value.recommend + "&district="
        + address.value.district + "&categoryName="
        + '领食霸王餐'
  })
}

const toPage = async (item, index) => {
  await toPageUtils(item)
}

onMounted(() => {

  setTimeout(() => {
    if (param.value?.type == 1) {
      uni.navigateTo({
        url: '/pages/shopdetail/shopdetail?id=' + param.value?.shopId + '&activeIndex=' + 0
      })
    }
  }, 1000)
})

// 获取sort barContent 高度
const getBarHeight = async () => {
  // 当前位置高度
  query.select(".dangqian_dizhi").boundingClientRect((data) => {
    /* #ifdef MP || APP-PLUS */
    addresHeight.value = data.height
    /* #endif */
    /* #ifdef H5 */
    addresHeight.value = data.height
    /* #endif */
    console.log('当前位置高度=', data.height)
  }).exec()
  // barContent高度
  query.select("#barContent").boundingClientRect((data) => {
        barContent.value = data.height
        // console.log('barContent=', data.height)
        // #ifdef H5
        barContent.value = barContent.value - 1
        // #endif
  }).exec();
}
// banner高度变量
const bannerHeight = ref(0)
// nav_meu_wrap 高度变量
const navMeuWrapHeight = ref(0)
// sortHeight筛选内容高度
const sortHeight = ref(0)
// 获取topContent的高度
const topContent = () => {
  // #ifdef H5
  query.select(".Top_wrap").boundingClientRect((data) => {
    bannerHeight.value = data.height + 315
  }).exec();
  // #endif
  // #ifdef MP
  query.select(".Top_wrap").boundingClientRect((data) => {
    bannerHeight.value = data.height + 300
  }).exec();
  // 筛选内容高度
  query.select("#sortMd").boundingClientRect((data) => {
    // console.log("筛选内容高度=", data.height)
    sortHeight.value = data.height
  }).exec()
  query.select("#top_content").boundingClientRect((data) => {
    // console.log("顶部内容高度=", data.height)
  }).exec()
  /* query.select("#homeTopOne").boundingClientRect((data) => {
    console.log("导航菜单Height=", data.height)
    // navMeuWrapHeight.value = data.height
  }).exec(); */
  // #endif
  // #ifdef APP-PLUS
  query.select(".Top_wrap").boundingClientRect((data) => {
    bannerHeight.value = data.height + 280
  }).exec();
  // #endif


}
// 下拉刷新店铺列表
const isRefresh = ref(false)
const onRefresh = async () => {
  getMenuListAndBanner()
  getCommonInfo()
  await getUpdateInfo()
}

// 获取霸王餐店铺列表
const queryList = (pageNo, pageSize) => {
  if (!city.value) {
    paging?.value.complete([]);
    return
  }
  isNodata.value = false
  // sortC?.value?.checkShopRe(sortType.value)
  // sortC1?.value?.checkShopRe(sortType.value)
  getNewShopListAPI({
      lat: address.value?.latitude,
      lng: address.value?.longitude,
      // lat: '26.569656',
      // lng: '106.696947',
      type: shopType.value, // 所属平台：1美团、 2饿了么、 3京东
      // is_orderable: sortType.value === 2 ? "0" : type4.value,
      is_orderable: is_orderable.value, // 只看可抢
      order_by: type1.value ? type1.value : sortType.value, // 排序
      shop_type: headerIndexTabs.value, // 0默认附近霸王餐、 1官返、 2官返霸王餐
      is_comment: type2.value, // 0默认全部、 1需要评论、 2无需评论
      is_new_shop: is_new_shop.value, // 1新店
      is_hot: isHot.value, // 1是品质商家、 0不是品质商家
      category: category_id.value, // 霸王餐分类id
      categoryTypeList: categoryTypeList.value, // 官返分类code
      is_ad: 1, // 1是广告
      pagePvId: pageNo === 1 ? "" : pagePvId.value,
      city: city.value,
      limit: pageSize,
      page: pageNo
    }).then(res => {
      // 页面滚动到最后一页并且页码大于1时(预防第一页没有10条数据)，重新请求第一页数据
      if (res.result.data.length < 10 && pageNo > 1) {

        console.log('page2==', pageNo)
        queryList(1, pageSize)
      }
      if (res.result.mt_message) {
        pagePvId.value = res.result.mt_message.pagePvId
        const meituanPvId = res.result.mt_message.meituanPvId
        res.result.data.forEach((item) => {
          item["meituanPvId"] = meituanPvId
        })
      }
      if (sortType.value === 2 && type4.value === 1) {
        res.result.data.forEach((item) => {
          item.isShow = 1000
          for (let i = 0; i < item.planActivityInfoList.length; i++) {
            if (item.planActivityInfoList[i].inventory > 0) {
              item.isShow = 0
              break;
            }
          }
        })
      }
      isNodata.value = true
      console.log('店铺列表内容=', res.result.data)
      paging?.value.complete(res.result.data);
      setTimeout(() => {
        isRefresh.value = false
      }, 280)
      // #ifdef APP-PLUS
      if (pageNo === 1) {
        checkUpdate()
      }
      // #endif
  }).catch(() => {
    paging?.value.complete(false);
    isRefresh.value = false
  })
}
const scrollToupper = () => {

}

const scrollTop = ref(0)
const opt = ref(0)
// 监听页面滚动
const onScrollChange = (e) => {
  scrollTop.value = e.detail.scrollTop
  // console.log('scrollTop=', e.detail.scrollTop)
  opt.value = (scrollTop.value / 68)
  if (barContent.value === 0) {
    getBarHeight()
  }
  /* if (scrollTop.value > 44) {
    getBarHeight()
  } */
}

onReachBottom(() => {
})
const refresherTouchstart = (e) => {
}
// 店铺栓选类型
const changeSortType = (type) => {
  scrollTopView()
  console.log('type=', type)
  // 只看可抢
  if(type.is_orderable){
    is_orderable.value = type.is_orderable
  }
  // order_by: 推荐0、发现最高4
  // type：推荐0、发现最高4
  if (type === 0 || type === 4){
    type === 0 ? type = 1 : ''
    type1.value = type
    // 新店重置
    is_new_shop.value = 0
    // 评鉴重置
    type2.value = 0
    // 品质商家重置
    isHot.value = 0
  }
  // 新店:is_new_shop
  if (type === 5) {
    is_new_shop.value = 1
    // 排序重置
    type1.value = 1
    // 评鉴重置
    type2.value = 0
    // 品质商家重置
    isHot.value = 0
  }
  // 无需评鉴：type5，值：type2=2
  if (type === 6) {
    type2.value = 2
    // 排序重置
    type1.value = 1
    // 新店重置
    is_new_shop.value = 0
    // 品质商家重置
    isHot.value = 0
  }
  // 品质商家：type7，值：is_hot=1
  if (type === 7) {
    isHot.value = 1
    // 排序重置
    type1.value = 1
    // 新店重置
    is_new_shop.value = 0
    // 需评鉴重置
    type2.value = 0
  }

  paging?.value.refresh();
}
// 附近霸王餐和官返霸王餐
const headerIndexTabs = ref(0)
const headerIndexFun = (shop_type) => {
  scrollTopView()
  console.log('sortHeight=', sortHeight.value)

  if (shop_type === 1){
    headerIndexTabs.value = 0
  } else {
    headerIndexTabs.value = shop_type
  }
  console.log("headerIndexTabs=", headerIndexTabs.value)
  paging?.value.refresh();
}
// 霸王餐nav筛选事件
const category_id = ref() // 霸王餐分类id
const categoryChangeFun = (id) => {
  scrollTopView()
  category_id.value = id
  // 重置官返商分类id
  categoryTypeList.value = ''
  paging?.value.refresh();
}
// 官返商nav筛选事件
const categoryTypeList = ref() // 官返商分类id
const categoryChangeGfFun = (code) => {
  scrollTopView()
  categoryTypeList.value = [code]
  // 重置霸王餐分类id
  category_id.value = ''
  paging?.value.refresh();
}
const sortChangeIndex = () => {
  scrollTopView()
  shopType.value = type3.value
  paging?.value.refresh();
}
const changeShop = (itemShop) => {
  for (let item in dataList.value) {
    if (itemShop.wmPoiId === item.wmPoiId) {
      item = itemShop
      return
    }
  }
}
const submitTel = async () => {

  if (!(/^1[0-9]{10}$/.test(tel.value + ""))) { // 使用正则表达式进行校验
    await uni.showToast({title: "手机号错误，请重新输入", icon: "none"})
  } else {
    console.log("是有效的手机号");
    await useUser.getUserInfo()
    await uni.showToast({title: "绑定成功", icon: "none"})
    bangdingShow.value = false
    paging?.value.reload();
  }
}
// 跳转官返霸王餐
const toGFBWC = () => {
  if (useUser.isLogin()) {
    uni.navigateTo({
      url: "/pages/kingeat/kingeat?latitude=" + address.value?.latitude + "&longitude=" + address.value?.longitude + "&addressStr=" + address.value?.recommend + "&city=" + city.value
    })
  }
}
// 品质专区是否存在变量
const isPZZQ = ref(false)
// 判断品质专区是否存在
const getBannerFun = (res) => {
  if (res){
    isPZZQ.value = true
  }
}
const isPermission = ref(false)
const isYJJJ = ref(false)
const showPermission = ref(false)
const getPermission = (type) => {
  if (type === 0) {
    uni.setStorageSync('locAuthorization', 0)
  }
  //检测使用设备,获取当前位置
  let platform = uni.getSystemInfoSync().platform
  if (platform === 'ios') {
    // 调起定位的函数 ,就是因为这个函数使用了uni.getLocation API 所以会弹出两次权限
    getLocation()
    // 如果用户允许了位置权限写入缓存
    uni.setStorageSync('locAuthorization', 1)
    isPermission.value = true
    console.log('授权了吗')
  }
  if (platform === 'android') {
    if (uni.getStorageSync('isPermission')) {
      isPermission.value = true
      getLocation()
    } else {
      isPermission.value = false
    }
    return
  }
  if (platform === 'android') {
    if (!uni.getStorageSync('locAuthorization') || uni.getStorageSync('locAuthorization') === 0) {
      uni.showModal({
        title: '提示',
        content: "为了给你展示附近的商家，需要您开启定位权限，获取您的位置信息？",
        confirmText: '同意授权',
        success: async function (res) {
          if (res.confirm) {
            showPermission.value = true
            await locCheck('android.permission.ACCESS_FINE_LOCATION')
          } else {
            uni.setStorageSync('locAuthorization', 1)
          }
        }
      })
    } else {
      if (uni.getStorageSync('isPermission')) {
        getLocation()
      }
    }
  }
}
const showTopPermission = ref(true)
const closeTopPermission = () => {
  showTopPermission.value = false
}
const showAuthPermission = () => {
  let platform = uni.getSystemInfoSync().platform
  if (platform === 'ios') {
    // 调起定位的函数 ,就是因为这个函数使用了uni.getLocation API 所以会弹出两次权限
    getLocation()
    // 如果用户允许了位置权限写入缓存
    uni.setStorageSync('locAuthorization', 1)
    isPermission.value = true
    console.log('授权了吗')
    return
  }
  if (platform === 'android') {
    if (uni.getStorageSync('isPermission')) {
      getLocation()
    } else {
      showPermission.value = true
      locCheck('android.permission.ACCESS_FINE_LOCATION')
    }
  }
}
const locCheck = async (permissionId) => {
  const result = await requestAndroidPermission(permissionId)
  showPermission.value = false
  uni.setStorageSync('locAuthorization', 1)
  if (result === 1) {
    //如果用户允许了位置权限写入缓存
    uni.setStorageSync('isPermission', true)
    isPermission.value = true
    getLocation()
  } else if (result === 0) {
    isPermission.value = false
  } else {
    isPermission.value = false
    isYJJJ.value = true
    uni.showModal({
      title: '提示',
      content: "你已拒绝权限申请,是否手动开启权限？",
      confirmText: '打开设置',
      success: async function (res) {
        if (res.confirm) {
          // 打开权限设置界面
          gotoAppPermissionSetting();
        }
      }
    })
  }
}
const showNotice = ref([])
const currentNoticeIndex = ref(0)
const closeNotice = () => {
  isShowNotice.value = false
  if (noticeItemId.value.is_read === 0 && useUser.isLoginBool()) {
    dealReadAPI(noticeItemId.value.id)
  }
  currentNoticeIndex.value = currentNoticeIndex.value + 1
  if (showNotice.value.length > currentNoticeIndex.value && currentNoticeIndex.value < 3) {
    noticeItem.value = showNotice.value[currentNoticeIndex.value].contents
    noticeItemId.value = showNotice.value[currentNoticeIndex.value]
    isShowNotice.value = true
  } else if (isHaveRead.value) {
    uni.showToast({title: '您还有未读通知，点击右上角消息查看', icon: 'none', duration: 3800})
  }
}
const scrollTopView = () => {
  // console.log('滚动去除顶部距离=', addresHeight.value + safeAreaHeight)
  isRefresh.value = true
  paging?.value.clear()
  query.select("#top_content")
      .boundingClientRect((data) => {
        console.log("top_content高度=", data.height)
        topContentHeight.value = data.height
        sort.value = data.height + 10
        paging.value.scrollToY(sort.value - addresHeight.value - safeAreaHeight, 0, false)
      }).exec();
}
const toNewUser = () => {
  uni.navigateTo({
    //url: "/pages/index/mt_phone_help"
    url: "/pages/index/novice"
  })
}
// 打开客服
const openService = () => {
  console.log('commonInfoStore.serviceUrl', commonInfoStore.serviceUrl)
  // #ifdef MP
  wx.openCustomerServiceChat({
    //企业微信的企业id
    corpId: commonInfoStore.serviceUrl.applet.appid,
    extInfo: {
      //客服链接
      url: commonInfoStore.serviceUrl.applet.path
    },
  })
  // #endif
  // #ifdef APP-PLUS
  plus.share.getServices(res => {
    const wxServices = res.find(i => i.id.toString() === 'weixin')
    if (wxServices) {
      wxServices.openCustomerServiceChat({
        corpid: commonInfoStore.serviceUrl.app.corpId,
        url: commonInfoStore.serviceUrl.app.url
      })
    }
  }, function (res) {
    console.log(JSON.stringify(res));
  })
  // #endif
  // #ifdef H5
  window.location.href = commonInfoStore.serviceUrl.h5.url
  // #endif
}

// 大活动弹窗提示是否打开
const isShowBigActivity = ref(false)
// 跳转活动页面
const toActivity = () => {
  isShowBigActivity.value  = false
  setTimeout(() => {
    uni.switchTab({
      url: '/pages/makemoney/makemoney'
    })
  },500)
}
// 获取弹窗popup数据
const CureentIndex = ref(0) // 当前弹窗索引
const isShowPopup = ref(false) // 弹窗是否显示
const popupTime = ref() // 弹窗弹出时间
const popupLoneTime = ref() // 弹窗关闭时的时长
const popupData = ref([])
const getPopup = async () => {
  console.log('当前弹窗是否关闭', isShowPopup.value)
  if (isShowPopup.value){
    const popup = await getPopupListAPI()
    popupData.value = popup.result
    popupTime.value = timestampToDate(new Date().getTime())
    /* popup.result.list.forEach((item, index) => {
      popupData.value.push({
        id: item.id,
        appid: item.appid,
        original_id: item.original_id,
        path: item.path,
        sort: item.sort,
        status: item.status,
        title: item.title,
        type: item.type,
        image: item.image,
        popup_time: new Date().getTime(),
      })
    }) */
    console.log('popupData===', popup.result)
    // 调用埋点事件
    await getEventTrackingFun('popupShow', popupData.value, popupTime.value, popupLoneTime.value)
  }
}
//  埋点数据事件
const getEventTrackingFun = async ( eventName, res, TriggerTime, TimeSlot) => {
  // console.log('当前弹窗id==',popupData.value[CureentIndex.value])
  await getEventTrackingAPI({
    user_id: useUser.userInfo?.id ? useUser.userInfo?.id : 0,
    device_id: deviceId ? deviceId : 0,
    event_name: eventName,
    extra_fields: {
      id: res.id,//弹窗id
      title: res.title,//弹窗标题
      trigger_time: TriggerTime , // 弹窗弹出时间
      time_slot: TimeSlot, //弹窗关闭时的时长
    },
  }).then(res => {
    console.log('res', res)
  }).catch(err => {
    console.log('err', err)
  })
}
// 分享新人专享
const popupClick = async (item) => {
  console.log('弹出数据=',item)
  // 调用埋点事件
  await getEventTrackingFun('popupClick', popupData.value, popupTime.value, popupLoneTime.value)
  // 判断是否登录
  if (!useUser.isLoginBool()) {
    useUser.isLogin()
    return
  }
  setTimeout(async () => {
    // 关闭弹窗
    isShowPopup.value = false
    // 存储弹窗是否弹过
    uni.setStorageSync('ispopShow', true)
    // 多个弹窗时候，跳转下一个弹窗
    /* CureentIndex.value += 1
    if (popupData.value[CureentIndex.value]){
      isShowPopup.value = true
      // 下一个弹窗的时间
      popupTime.value = timestampToDate(new Date().getTime())
      // 调用埋点事件
      await getEventTrackingFun('popupShow')
    } else {
      CureentIndex.value = CureentIndex.value - 1
      isShowPopup.value = false
    } */

    // 跳转到对应的页面
    await toPageUtils(item);
  }, 1500)
}
// 弹窗关闭事件
const popupClose = async () => {
  // console.log('弹窗数据=', popupData.value)
  isShowPopup.value = false
  // 存储弹窗是否弹过
  uni.setStorageSync('ispopShow', true)
  // 计算用户停留时长/秒
  popupLoneTime.value = new Date(new Date().getTime() - Date.parse(popupTime.value)).getSeconds()
  console.log('时长==',popupLoneTime.value)
  // 调用埋点事件
  await getEventTrackingFun('popupClose', popupData.value, popupTime.value, popupLoneTime.value)
  setTimeout(async () => {
    // 多个弹窗时候，跳转下一个弹窗
    /* CureentIndex.value += 1
    if (popupData.value[CureentIndex.value]){
      isShowPopup.value = true
      // 下一个弹窗的时间
      popupTime.value = timestampToDate(new Date().getTime())
      // 调用埋点事件
      await getEventTrackingFun('popupShow')
    } else {
      CureentIndex.value = CureentIndex.value - 1
      isShowPopup.value = false
    } */
  }, 1000)
}


// 新手引导弹窗是否显示
const isShowNewUser = ref(false)
// 新手引导数据
const stepData = ref([
  {
    id: 1,
    img: '/home/newUser/new_user_img01.png',
    title: '找一家心仪的店铺，点击【立即报名】',
    desc: ['多活动店铺只能同时报名一个活动'],
  },
  {
    id: 2,
    img: '/home/newUser/new_user_img02.png',
    title: '进入活动页后,点击【领红包并立即报名】',
    desc: ['① 必须先报名再下单，否则无法返利', '② 要求提交美团账号的，外卖下单账号必须 与报名时提交的美团账号一致；否则无法 返利'],
  },
  {
    id: 3,
    img: '/home/newUser/new_user_img03.png',
    title: '报名成功后,进入对应店铺下单',
    desc: ['点餐时，有实付要求的，必须满足实付满返 条件，否则无法提交订单返利'],
  },
  {
    id: 4,
    img: '/home/newUser/new_user_img04.png',
    title: '下单后，回到平台提交订单号，延长凭证 上传时间',
    desc: ['收餐后，回到平台按照指引上传对应截图'],
  },
  {
    id: 5,
    img: '/home/newUser/new_user_img05.png',
    title: '上传结束后，等待审核减免到账',
    desc: ['收到减免金额，提现秒到账'],
  },
])
// 新手引导步数
const currentStep = ref(0)
// 下一步事件
const nextStepFun = () => {
  if (currentStep.value >= stepData.value.length-1){
    return
  }else {
    currentStep.value ++
  }
  console.log('currentStep=', currentStep.value)
}
// 新手引导的change事件
const swiperChange = (e) => {
  currentStep.value = e.detail.current
}
// 报名下单
const goToSignUpFun = () => {
  isShowNewUser.value = false
  commonInfoStore.getShowExecuteEvent(false)
}

const findcountdown = (item) => {
  let nowTime = +new Date()
  let putTime = +new Date(item.end_time)
  return (putTime - nowTime)
}
// 待完成订单数据
const orderList = ref([])
const getorderListFun = () => {
  orderList.value = []
  getOrderGFListsAPI({
    status: '-1',
    limit: 10,
    page: 1
  }).then(res => {
    console.log('订单数据=',  res.result)
    res.result.forEach(item => {
      if (item.status === 0 && item.is_cancel === 0 && item.check_status === 0){
        orderList.value.push(item)
      } else if (item.status === 0 && item.is_cancel === 0 && item.check_status === 3){
        orderList.value.push(item)
      } else if (item.status === 0 && item.is_cancel === 0 && item.check_status === 4){
        orderList.value.push(item)
      } else if (item.status === 2 && item.is_cancel === 0 && item.check_status === 3){
        orderList.value.push(item)
      } else if (item.code == 3 || item.code == 4){
        orderList.value.push(item)
      }
    })
    console.log('获取待完成订单=', orderList.value)

  }).catch((err) => {
    uni.showToast( {
      title: err.msg,
      icon: 'none',
      duration: 2000
    })
  })
}
// 待完成订单点击事件
const goToOrderCheckFun = (item) => {
  // 霸王餐已报名，待提交订单号
  if (item.status === 0 && item.is_cancel === 0 && item.check_status === 0){
    uni.navigateTo( {
      url: "/pages_shopdetail/shop_process?orderId=" + item.id + "&signUp=3"
    })
  }
  // 获取设备信息
  let deviceInfo = uni.getSystemInfoSync().uniPlatform
  // 霸王餐已提交订单号，待上传凭证
  if (item.status === 0 && item.is_cancel === 0 && item.check_status >= 3 || item.status === 2){
    let order = "order"
    if (deviceInfo == 'app'){
      uni.navigateTo( {
        url: "/pages_order/order_app_voucher?orderID=" + item.id + "&source=order"
      })
    } else {
      uni.navigateTo( {
        url: "/pages_order/order_voucher?orderID=" + item.id + "&source=order"
      })
    }

  }
  // 官返已报名，去下单 备注：3不能用===，因为3是字符串
  else if (item.code == 3){
    uni.navigateTo( {
      url: "/pages_shopdetail/shop_process_gf?shopGF=" + encodeURIComponent(JSON.stringify(item)) + "&signUp=2"
    })
  }
  // 官返已下单，去评价备注：4不能用===，因为4是字符串
  else if (item.code == 4){
    uni.navigateTo( {
      url: "/pages_shopdetail/shop_process_gf?shopGF=" + encodeURIComponent(JSON.stringify(item)) + "&signUp=2"
    })
  }
}
</script>

<template>
  <view class="content" v-if="isNetwork">

    <z-paging ref="paging" v-model="dataList"
              @query="queryList"
              @onRefresh="onRefresh"
              @scroll="onScrollChange"
              :default-page-size="10"
              @scrolltoupper="scrollToupper"
              @refresherTouchstart="refresherTouchstart"
              :auto-show-back-to-top="true"
              back-to-top-bottom="100"
              back-to-top-threshold="50"
              :back-to-top-style="{right: '10rpx',width: '70rpx',height: '70rpx'}"
              :auto-hide-loading-after-first-loaded="false">
      <!--Banner style="height: 1276rpx;"-->
      <view id="top_content" >
        <!-- #ifdef MP-WEIXIN ||  APP-PLUS-->
        <!--<view class="home_bg" style="position: absolute;width: 100%;margin-top:438rpx;height: 368rpx;z-index: -1"></view>-->
        <!-- #endif -->
        <!-- #ifdef H5-->
        <!--<view class="home_bg" style="position: absolute;width: 100%;margin-top:438rpx;height: 368rpx;z-index: -1"></view>-->
        <!-- #endif -->
        <view class="Top_wrap">
          <!--banner的盒子-->
          <view class="My_top1">
            <swiper :autoplay="false" interval="5000" :circular="true" class="banner_img" v-if="bannerData.length>0">
              <swiper-item v-for="(bannerItem, bannerIndex) in bannerData" :key="bannerIndex">
                <!--              <image :src="bannerItem.bg" @tap="onToPage(bannerItem)"></image>-->
                <!--首页banner显示内容-->
                <view class="banner_content">
                  <view v-for="(materialsItem, materialsIndex) in bannerItem.materials" :key="materialsIndex" style="margin:0 auto;position: relative;">
                    <!-- #ifdef H5 -->
                    <view>
                      <wx-open-launch-weapp id="launch-btn"
                                            :username="materialsItem.original_id" :path="materialsItem.path"
                                            style="position: absolute;z-index: 1;left: 0;height: 100%;width: 100%;opacity: 0.01;background-color: #1db9ff;">
                        <component :is="'script'" type='text/wxtag-template' style="display: block;">
                          <div style="position: absolute;top: 0; left: 0; width: 100%;height: 100% ; opacity: 0"></div>
                        </component>
                      </wx-open-launch-weapp>
                    </view>
                    <!-- #endif -->
                    <!--<image :src="materialsItem.image" @tap="onToPage(materialsItem)" :style="{width: materialsItem.width + 'rpx', height: materialsItem.height + 'rpx'}"></image>-->
                    <view @tap="onToPage(materialsItem)">
                      <!--<cache-image :img-src="materialsItem.image" :isimg="true" imgMode="widthFix" :imageStyle="{width: materialsItem.width + 'rpx', height: materialsItem.height + 'rpx'}"></cache-image>-->
                      <image :src="materialsItem.image" mode="widthFix" :style="{width: materialsItem.width + 'rpx', height: materialsItem.height + 'rpx'}"></image>
                    </view>

                  </view>
                  <!--<image :src="BaseImgUrl + '/home/banner/banner_img01.png'" @tap="onToPage(bannerItem)" :style="{width: '176rpx', height: '156rpx'}"></image>
                  <image :src="BaseImgUrl + '/home/banner/banner_img02.png'" @tap="onToPage(bannerItem)" :style="{width: '300rpx', height: '204rpx'}"></image>
                  <image :src="BaseImgUrl + '/home/banner/banner_img03.png'" @tap="onToPage(bannerItem)" :style="{width: '176rpx', height: '156rpx'}"></image>-->
                </view>
                <!--banner的背景 @tap="onToPage(bannerItem)"-->
                <view>
                  <cache-image :img-src="bannerItem.bg"  width="100%" height="600rpx"></cache-image>
                </view>
                <!--<image :src="BaseImgUrl + '/home/home_banner_foot.png'" style="width: 100%;height: 60rpx;position: absolute;bottom: 0rpx;z-index: 10;"></image>-->
              </swiper-item>
            </swiper>
          </view>
          <!--头部当前定位和搜索内容-->
          <view id="barContent" class="barContentAll barContent"
                :style="{backgroundColor:  `rgba(255, 255, 255, ${opt-0.5})` }">
            <view class="bar-bg">
              <u-status-bar></u-status-bar>
              <!--address-->
              <view class="dangqian_dizhi" :style="{width: menuRightWidth - 5 + 'px'}">
                <!--不是浮动的定位-->
                <view v-if="scrollTop < 44" @click="chooseLoc()" class="dangqian_dizhi_left">
                  <!--<image :src="BaseImgUrl + '/group/location.png'"></image>-->
                  <u-icon name="map" size="20" color="#ffffff"></u-icon>
                  <!-- #ifdef APP-PLUS -->
                  <view :class="['cityName']" v-if="isPermission">
                    {{
                      address?.recommend ? address.recommend : '正在定位中……'
                    }}
                  </view>
                  <view :class="['cityName']" v-else @click.stop="showAuthPermission">
                    {{
                      address?.recommend ? address.recommend : '请同意定位授权或手动开启定位权限'
                    }}
                  </view>
                  <!-- #endif -->
                  <!-- #ifdef MP-WEIXIN || H5-->
                  <view :class="[isNoLocal?'cityName1':'cityName']" v-if="!getAddressFailed">
                    {{
                      address?.recommend ? address.recommend : '获取定位失败，点击重试'
                    }}
                  </view>
                  <view :class="[isNoLocal?'cityName1':'cityName']" v-else-if="!isNoLocal">
                    {{
                      address?.recommend ? address.recommend : '正在定位中……'
                    }}
                  </view>
                  <view :class="[isNoLocal?'cityName1':'cityName']" v-else>
                    {{
                      address?.recommend ? address.recommend : '请手动开启定位权限'
                    }}
                  </view>
                  <!-- #endif -->
                  <u-icon name="arrow-right" size="16" color="#FFFFFF"></u-icon>
                </view>
                <!--浮动的定位-->
                <view v-if="scrollTop > 44" @click="chooseLoc()" class="dangqian_dizhi_left" :style="{maxWidth: '210rpx'}">
                  <!--<image :src="BaseImgUrl + '/group/location.png'"></image>-->
                  <u-icon name="map" size="20" color="#333333"></u-icon>
                  <!-- #ifdef APP-PLUS -->
                  <view :class="['cityName']" v-if="isPermission" :style="{color: `rgba(0,0,0,${opt-0.5})`}">
                    {{
                      address?.district ? address.district : '正在定位中……'
                    }}
                  </view>
                  <view :class="['cityName']" v-else @click.stop="showAuthPermission" :style="{color: `rgba(0,0,0,${opt-0.5})`}">
                    {{
                      address?.district ? address.district : '请同意定位授权或手动开启定位权限'
                    }}
                  </view>
                  <!-- #endif -->
                  <!-- #ifdef MP-WEIXIN || H5-->
                  <view :class="[isNoLocal?'cityName1':'cityName']" v-if="!getAddressFailed" :style="{color: `rgba(0,0,0,${opt-0.5})`}">
                    {{
                      address?.district ? address.district : '获取定制失败，点击重试'
                    }}
                  </view>
                  <view :class="[isNoLocal?'cityName1':'cityName']" v-else-if="!isNoLocal" :style="{color: `rgba(0,0,0,${opt-0.5})`}">
                    {{
                      address?.district ? address.district : '正在定位中……'
                    }}
                  </view>
                  <view :class="[isNoLocal?'cityName1':'cityName']" v-else :style="{color: `rgba(0,0,0,${opt-0.5})`}">
                    {{
                      address?.district ? address.district : '请手动开启定位权限'
                    }}
                  </view>
                  <!-- #endif -->
                  <u-icon name="arrow-right" size="16" color="#333333"></u-icon>
                </view>
                <view v-if="scrollTop < 44" class="dangqian_dizhi_right">
                  <swiper class="swiper" circular next-margin="0rpx" previous-margin="0rpx" vertical="true" :autoplay="true" >
                    <swiper-item v-for="(item,index) in logoImg" :key="index">
                      <view class="swiper-item" style="text-align: center;padding: 10rpx 0;">
                        <!--<image :src="BaseImgUrl + item.img" style="width: 164rpx;height: 36rpx"></image>-->
                        <cache-image :img-src="BaseImgUrl + item.img" :isimg="true" imgMode="widthFix" :image-style="{width:'164rpx',height:'36rpx'}"></cache-image>
                      </view>
                    </swiper-item>
                  </swiper>
                  <!--<image :src="BaseImgUrl + '/home/home_top_img02.png'" mode="heightFix" style="height: 36rpx;"></image>-->
                </view>
                <!--  搜索-->
                <view v-if="scrollTop > 44" class="sousuo_box" @click="toSearch()" >
                  <view class="input_box" :style="{border: `1px solid rgba(255,105,30,${opt-0.5})`}">
                    <u-icon name="search" size="24" color="#AEAEAE"></u-icon>
                    <!-- 👉🔥⭐✨ -->
                    请输入店铺...
                  </view>
                  <view class="sousuo_btn">搜索</view>
                </view>
              </view>
              <view v-if="scrollTop < 44" class="nav_box">
              <!--签到-->
                <!--<view class="left_box">
                  <view @click="singIn()">
                    <cache-image :img-src="BaseImgUrl + '/home/74.gif'"
                                 height="70rpx" width="70rpx"/>
                  </view>
                  &lt;!&ndash; <image :src="BaseImgUrl + '/home/74.gif'" mode="widthFix" @click="singIn()"></image>&ndash;&gt;
                </view>-->
                <!--  搜索-->
                <view class="sousuo_box" @click="toSearch()">
                  <view class="input_box">
                    <u-icon name="search" size="24" color="#AEAEAE"></u-icon>
                    <!-- 👉🔥⭐✨ -->
                    请输入店铺名称或商家名称...
                    <text style="color: #f8f6f7;font-size: 10rpx">{{ barContent }}</text>
                  </view>
                  <view class="sousuo_btn">搜索</view>
                </view>
                <view class="right_box">
                  <!--<view @click="isShowRedBag = true">
                    <cache-image :img-src="BaseImgUrl + '/home/35.gif'"
                                 height="70rpx" width="70rpx"/>
                  </view>-->
                  <view @click="toMsg()">
                    <!--<cache-image :img-src="BaseImgUrl + '/home/21.gif'" height="70rpx" width="70rpx"/> -->
                    <u-icon name="chat" size="32" color="#333333"></u-icon>
                    <view v-if="msgList.length>0" class="tixing_box">{{ msgList.length }}</view>
                    <view v-else class="tixing"></view>
                  </view>
                  <!--                <image :src="BaseImgUrl + '/home/35.gif'" mode="widthFix" @click="isShowRedBag = true"></image>-->
                  <!--                <image :src="BaseImgUrl + '/home/21.gif'" mode="widthFix" @click="toMsg()"></image>-->

                </view>
              </view>
            </view>
            <!--区别iphone16的安全区域高度-->
            <view v-if="scrollTop > bannerHeight" style="width: 100%;height: 16rpx;background: #FFFFFF;"></view>
          </view>
        </view>
        <!--内容1透明边框-->
        <!-- #ifdef H5-->
        <view id="homeTopOne" class="homeTopOne" style="margin-top: -150rpx; ">
          <view class="homeTopOne_border" style="top: -8rpx"></view>
          <!--导航菜单  -->
          <view class="nav_meu_wrap" v-if="menuList.length>0">
            <view class="nav_menu_wrap_box">
              <view v-for="(item, index) in menuList[0]" :key="index" @tap="toPage(item, index)" class="nav_menu_item" style="position: relative">
                <!-- #ifdef H5 -->
                <view v-if="item.type === 4">
                  <wx-open-launch-weapp id="launch-btn"
                                        :username="item.original_id" :path="item.path"
                                        style="position: absolute;z-index: 1;left: 0;height: 100%;width: 100%;opacity: 0.01;background-color: #1db9ff;">
                    <component :is="'script'" type='text/wxtag-template' style="display: block;">
                      <div style="position: absolute;top: 0; left: 0; width: 100%;height: 100% ; opacity: 0"></div>
                    </component>
                  </wx-open-launch-weapp>
                </view>
                <!-- #endif -->
                <image class="swiper_image" :src="BaseURL + item.image" mode="widthFix" style="width: 80rpx;height: 80rpx;"></image>
                <view class="nav_menu_item_text">{{ item.name }}</view>
              </view>
            </view>
            <view class="nav_menu_wrap_box">
              <view v-for="(item, index) in menuList[1]" :key="index" @tap="toPage(item, index)" class="nav_menu_item">
                <!-- #ifdef H5 -->
                <view v-if="item.type === 4">
                  <wx-open-launch-weapp id="launch-btn"
                                        :username="item.original_id" :path="item.path"
                                        style="position: absolute;z-index: 1;left: 0;height: 100%;width: 100%;opacity: 0.01;background-color: #1db9ff;">
                    <component :is="'script'" type='text/wxtag-template' style="display: block;">
                      <div style="position: absolute;top: 0; left: 0; width: 100%;height: 100% ; opacity: 0"></div>
                    </component>
                  </wx-open-launch-weapp>
                </view>
                <!-- #endif -->
                <image class="swiper_image" :src="BaseURL + item.image" mode="widthFix" style="width: 80rpx;height: 80rpx;"></image>
                <view class="nav_menu_item_text">{{ item.name }}</view>
              </view>
            </view>
            <!--<swiper class="sssswiper" @change="gridChange" :current="currentMenuIndex">
              <swiper-item v-for="(itema, indexa) in menuList" :key="indexa">
                <u-grid col="5" :border="false">
                  <u-grid-item v-for="(itemg, indexs) in itema" @click="toPage(itemg, indexs)"
                               :index="indexs"
                               :key="indexs"
                               :customStyle="{padding: '10rpx 0'}">
                    <view v-if="itemg.type === 4">
                      &lt;!&ndash; #ifdef H5 &ndash;&gt;
                      <wx-open-launch-weapp id="launch-btn"
                                            :username="itemg.original_id" :path="itemg.path"
                                            style="position: absolute;z-index: 89;left: 0;width: 100%;height:100%;opacity: 0.01;background-color: #1db9ff">
                        <component :is="'script'" type='text/wxtag-template' style="display: block;">
                          <div style="position: absolute;top: 0; left: 0; width: 100%;height: 100% ; opacity: 0"></div>
                        </component>
                      </wx-open-launch-weapp>
                      &lt;!&ndash; #endif &ndash;&gt;
                      <view style="width: 100%;display: flex;align-items: center">
                        <image class="swiper_image" :src="BaseURL + itemg.image" mode="widthFix"></image>
                      </view>
                      <view class="grid-text">{{ itemg.name }}</view>
                    </view>

                    <view v-else>
                      <view style="width: 100%;display: flex;align-items: center">
                        <image class="swiper_image" :src="BaseURL + itemg.image" mode="widthFix"></image>
                      </view>
                      <view class="grid-text">{{ itemg.name }}</view>
                    </view>
                  </u-grid-item>
                </u-grid>

              </swiper-item>
            </swiper>-->
            <!--<view style="width: 80rpx;height: 6rpx;background-color: rgb(255,241,203);border-radius: 10rpx;margin: 4rpx auto 2rpx">
              <view :style="{width: '40rpx',height: '6rpx',backgroundColor: '#ffba0a',borderRadius: '10rpx', transition: 'all 0.3s',
            transform:currentMenuIndex===0?'translateX(0)':'translateX(40rpx)'}"></view>
            </view>-->
          </view>
          <!--任务挑战赛-->
          <!--<lszbg_challenge></lszbg_challenge>-->
          <!--品质专区-->
          <view v-if="address?.recommend" class="pmeg_box" >
            <pmeg :pzList="pzList" :posterBanner="posterBanner" :address="address" :newUser="newUser" v-if="address?.recommend.length > 0" @toGFBWC="toGFBWC" @getBannerFun="getBannerFun"></pmeg>
          </view>
          <!--new user 管返-->
          <!--          <gf_model :address="address" @toGFBWC="toGFBWC" v-if="bannerData"></gf_model>-->
          <!--通知通告-->
          <view class="TongZhi_wrap" v-if="noticeData.length > 0">
            <view class="TongZhi_item" @click="chakanNoti(noticeData[0].contents)">
              <image :src="BaseImgUrl + '/home/gonggao.png'" mode="widthFix"></image>
              <view class="tz_wenan">
                <u-notice-bar icon="" bgColor="#FFF" direction="column" duration="3000" @click="lockNotice"
                              :disableTouch="true"
                              color="#333" :text="noticesStr"></u-notice-bar>
              </view>
              <view class="ta_right_icon">
                <u-icon class="icon" name="arrow-right" color="#A5A5A5" size="18"></u-icon>
              </view>
            </view>
          </view>
          <!--<view @click="PZZQ" v-if="address?.recommend && pzList?.length > 0">
            <pzzq :address="address" :pzList="pzList" v-if="address?.recommend.length > 0"></pzzq>
          </view>-->
        </view>
        <!-- #endif -->
        <!-- #ifdef MP-WEIXIN ||  APP-PLUS-->
        <view id="homeTopOne" class="homeTopOne">
          <view class="homeTopOne_border"></view>
          <!--导航菜单 id="nav_meu_wrap" v-if="menuList.length>0"-->
          <view id="nav_meu_box" class="nav_meu_wrap" >
            <view class="nav_menu_wrap_box">
              <view v-for="(item, index) in menuList[0]" :key="index" @tap="toPage(item, index)" class="nav_menu_item">
                <!--<image class="swiper_image" :src="BaseURL + item.image" mode="widthFix" style="width: 80rpx;height: 80rpx;"></image>-->
                <cache-image :img-src="BaseURL + item.image" :isimg="true" imgMode="widthFix" :image-style="{width:'80rpx',height:'80rpx'}"></cache-image>
                <view class="nav_menu_item_text">{{ item.name }}</view>
              </view>
            </view>
            <view class="nav_menu_wrap_box">
              <view v-for="(item, index) in menuList[1]" :key="index" @tap="toPage(item, index)" class="nav_menu_item">
                <!--<image class="swiper_image" :src="BaseURL + item.image" mode="widthFix" style="width: 80rpx;height: 80rpx;"></image>-->
                <cache-image :img-src="BaseURL + item.image" :isimg="true" imgMode="widthFix" :image-style="{width:'80rpx',height:'80rpx'}"></cache-image>
                <view class="nav_menu_item_text">{{ item.name }}</view>
              </view>
            </view>
            <!--<swiper class="sssswiper" @change="gridChange" :current="currentMenuIndex">
              <swiper-item v-for="(itema, indexa) in menuList" :key="indexa">
                <u-grid col="5" :border="false">
                  <u-grid-item v-for="(itemg, indexs) in itema" @click="toPage(itemg, indexs)"
                               :index="indexs"
                               :key="indexs"
                               :customStyle="{padding: '10rpx 0'}">
                    <view v-if="itemg.type === 4">
                      &lt;!&ndash; #ifdef H5 &ndash;&gt;
                      <wx-open-launch-weapp id="launch-btn"
                                            :username="itemg.original_id" :path="itemg.path"
                                            style="position: absolute;z-index: 89;left: 0;width: 100%;height:100%;opacity: 0.01;background-color: #1db9ff">
                        <component :is="'script'" type='text/wxtag-template' style="display: block;">
                          <div style="position: absolute;top: 0; left: 0; width: 100%;height: 100% ; opacity: 0"></div>
                        </component>
                      </wx-open-launch-weapp>
                      &lt;!&ndash; #endif &ndash;&gt;
                      <view style="width: 100%;display: flex;align-items: center">
                        <image class="swiper_image" :src="BaseURL + itemg.image" mode="widthFix"></image>
                      </view>
                      <view class="grid-text">{{ itemg.name }}</view>
                    </view>

                    <view v-else>
                      <view style="width: 100%;display: flex;align-items: center">
                        <image class="swiper_image" :src="BaseURL + itemg.image" mode="widthFix"></image>
                      </view>
                      <view class="grid-text">{{ itemg.name }}</view>
                    </view>
                  </u-grid-item>
                </u-grid>

              </swiper-item>
            </swiper>-->
            <!--<view style="width: 80rpx;height: 6rpx;background-color: rgb(255,241,203);border-radius: 10rpx;margin: 4rpx auto 2rpx">
              <view :style="{width: '40rpx',height: '6rpx',backgroundColor: '#ffba0a',borderRadius: '10rpx', transition: 'all 0.3s',
            transform:currentMenuIndex===0?'translateX(0)':'translateX(40rpx)'}"></view>
            </view>-->
          </view>
          <!--任务挑战赛-->
          <!--<lszbg_challenge></lszbg_challenge>-->
          <!--中间模块-->
          <view v-if="address?.recommend" class="pmeg_box" >
            <pmeg :pzList="pzList" :posterBanner="posterBanner" :address="address" :newUser="newUser" v-if="address?.recommend.length > 0" @toGFBWC="toGFBWC" @getBannerFun="getBannerFun"></pmeg>
          </view>
          <!--new user 管返-->
          <!--          <gf_model :address="address" @toGFBWC="toGFBWC" v-if="bannerData"></gf_model>-->
          <!--通知通告-->
          <view class="TongZhi_wrap" v-if="noticeData.length > 0">
            <view class="TongZhi_item" @click="chakanNoti(noticeData[0].contents)">
              <image :src="BaseImgUrl + '/home/gonggao.png'" mode="widthFix"></image>
              <view class="tz_wenan">
                <u-notice-bar icon="" bgColor="#FFF" direction="column" duration="3000" @click="lockNotice"
                              :disableTouch="true"
                              color="#333" :text="noticesStr"></u-notice-bar>
              </view>
              <view class="ta_right_icon">
                <u-icon class="icon" name="arrow-right" color="#A5A5A5" size="18"></u-icon>
              </view>
            </view>
          </view>
          <!--          <view @click="PZZQ" v-if="address?.recommend && pzList?.length > 0">-->
          <!--            <pzzq :address="address" :pzList="pzList" v-if="address?.recommend.length > 0"></pzzq>-->
          <!--          </view>-->
        </view>
        <!-- #endif -->
      </view>

      <!--店铺筛选 bannerHeight + navMeuWrapHeight + pzzqHeight-->
      <view id="sortMd" class="sortMd" :class="scrollTop > bannerHeight ? 'sortMd_active' : ''" :style="{top:addresHeight + safeAreaHeight + 'px',height: headerIndexTabs === 2 ? '224rpx' : '298rpx'}">
        <sort
            v-model:sortType="sortType"
            v-model:type1="type1"
            v-model:type2="type2"
            v-model:type3="type3"
            v-model:type4="type4"
            :overlordMealClassList="overlordMealClassList"
            @change="changeSortType"
            @sortChange="sortChangeIndex"
            @headerIndex="headerIndexFun"
            @categoryChange="categoryChangeFun"
            @categoryChangeGf="categoryChangeGfFun"
        >
        </sort>
      </view>
      <!--列表内容-->
      <view class="content_list" :style="{marginTop: headerIndexTabs === 2 ? '-224rpx' : '-298rpx'}">
        <!--主题内容背景-->
        <view class="theme_content_bg"></view>
        <view :style="{height: headerIndexTabs === 2 ? '254rpx' : '284rpx'}"></view>
        <!--店铺列表-->
        <view class="home_shop_box" :style="{minHeight: screenHeight + 'px'}">
          <view style="position: relative;z-index: 1">
            <!--遍历列表数据-->
            <view v-for="(items,index) in dataList" v-show="dataList.length > 0" :key="index" class="shops_list">
              <view v-if="items.isShow === 1000"></view>
              <shop-item v-else-if="items.shop_type === 1 && items.data_type === 'goods'" :items="items" :newUser="newUser"></shop-item>
              <shop-item-g-f v-else-if="items.shop_type === 2  && items.data_type === 'goods'" :items="items" :newUser="newUser" @changeShop="changeShop"></shop-item-g-f>
              <shop-list-banner-item v-else-if="items.data_type == 'ad'" :items="items" :newUser="newUser" :addressVal="address"></shop-list-banner-item>
            </view>
          </view>
          <view v-if="address.recommend && dataList.length === 0 && isNodata">
            <u-empty
                text="无数据 ···"
                icon="https://img.alicdn.com/imgextra/i2/3829152210/O1CN01lHi68c1SCE3JVy9Qs_!!3829152210.png"
                icon-size="400"
            ></u-empty>
          </view>
          <view style="position: absolute;z-index: 2;top: 0;background-color: #F6F6F6;width: 550rpx;padding: 80rpx;"
                :style="{minHeight: screenHeight + 'px'}" v-show="isRefresh">
            <u-loading-icon color="#F97632"></u-loading-icon>
            <view
                style="font-size: 26rpx;font-weight: 600;color: #F97632;text-align: center;box-sizing: border-box;padding: 20rpx 0 60rpx 0;">
              正在为您加载附近店铺
            </view>
          </view>
          <!-- #ifdef H5 -->
          <view
              style="display: flex;flex-direction: column;align-items: center;padding-top: 80rpx;background-color: #F6F6F6;"
              v-if="dataList.length === 0  && !isNodata">
            <u-loading-icon color="#F97632" v-if="!address.recommend || dataList.length === 0"></u-loading-icon>
            <view v-if="dataList.length === 0"
                  style="font-size: 26rpx;font-weight: 600;color: #F97632;text-align: center;box-sizing: border-box;padding: 20rpx 0 60rpx 0;">
              正在为您加载附近店铺
            </view>
            <view v-if="!address.recommend"
                  style="font-size: 26rpx;font-weight: 600;color: #F97632;text-align: center;box-sizing: border-box;padding: 20rpx 0 60rpx 0;">
              获取位置信息
            </view>
          </view>
          <!-- #endif -->
          <!-- #ifdef APP-PLUS || MP-WEIXIN -->
          <view
              style="display: flex;flex-direction: column;align-items: center;padding-top: 80rpx;background-color: #F6F6F6;"
              v-if="dataList.length === 0  && !isNodata && isPermission">
            <u-loading-icon color="#F97632"></u-loading-icon>
            <view v-if="address.recommend"
                  style="font-size: 26rpx;font-weight: 600;color: #F97632;text-align: center;box-sizing: border-box;padding: 20rpx 0 60rpx 0;">
              正在为您加载附近店铺
            </view>
            <view v-if="!address.recommend"
                  style="font-size: 26rpx;font-weight: 600;color: #F97632;text-align: center;box-sizing: border-box;padding: 20rpx 0 60rpx 0;">
              获取位置信息
            </view>
          </view>
          <!-- #endif -->
        </view>
      </view>



      <template #bottom>
        <!-- #ifdef H5 -->
        <lszbg-dowload></lszbg-dowload>
        <!-- #endif -->
        <!-- #ifdef APP-PLUS -->
        <view
            style="background-color: #fcf2e8;padding: 20rpx;font-size: 28rpx;display: flex;align-items: center"
            v-if="!isPermission && showTopPermission && !showPermission">
          <view style="margin-right: 20rpx" @click="closeTopPermission">
            <u-icon name="close" size="22" color="#999999"/>
          </view>
          <view style="flex: 1">
            <view style="font-weight: bold;letter-spacing: 6rpx;color: #eb8925">定位服务未开启</view>
            <view style="height: 10rpx"></view>
            <view style="color: #eb8925;letter-spacing: 2rpx;line-height: 38rpx;font-size: 24rpx;">
              开启后才能看到附近的霸王餐活动哦~
            </view>
          </view>
          <view style="padding: 10rpx 26rpx;;background-color: #fa7803;border-radius: 60rpx;color: white"
                @click="showAuthPermission">
            立即开启
          </view>
        </view>
        <!-- #endif -->
      </template>
      <template #refresher>
        <!-- 此处的custom-refresh为demo中自定义的组件，非z-paging的内置组件，请在实际项目中自行创建。这里插入什么view，下拉刷新就显示什么view -->
        <view style="display: flex;justify-content: center;align-items: center;padding-top: 120rpx;">
          <cache-image style="width: 110rpx;height: 110rpx;margin: auto"
                       img-src="https://lsz.lszbg.com/imgs/logo_loading.gif" height="110rpx" width="110rpx">

          </cache-image>
        </view>
      </template>
      <template #empty>
        <view class="noData_box" v-if="!isPermission">
          <image :src="BaseImgUrl + '/images/noweizhi.png'"></image>
          <view class="lijipay" @click="showAuthPermission">
            <text class="get_p">请先授权位置</text>
          </view>
        </view>
      </template>
      <!-- 自定义的没有更多数据view -->
      <template #loadingMoreNoMore>
        <view class="null_text">没有更多数据</view>
      </template>
    </z-paging>
  </view>
  <view v-else>
    <view v-if="platform === 'ios' && getNetCount > 5"
          style="height: 500rpx;text-align: center;font-size: 26rpx;color: #888888;display: flex;align-items: center;flex-direction: column;margin: 60rpx">
      <view style="height: 200rpx"></view>
      <view>
        当前无网络，请检查您的网络链接，或检查APP网络权限是否开启；
      </view>
      <view style="height: 30rpx"></view>
      <view>
        设置-领食周边购APP-无线数据，允许使用数据！
      </view>
      <view style="height: 30rpx"></view>
      <view
          style="border-radius: 60rpx;width: 200rpx;height: 68rpx;line-height: 68rpx;text-align: center;background-color: #E0E0E0;margin-top: 20rpx;"
          @click="openSettings">
        去设置
      </view>
    </view>
  </view>

  <!-- #ifdef MP-WEIXIN -->
  <view class="topTip" v-if="showAdd" @click="showAdd=false">
    <view>
      <u-status-bar></u-status-bar>
    </view>
    <view class="icons">
      <u-icon name="arrow-up-fill" color="#000000" size="18" top="6"></u-icon>
    </view>
    <view class="tipAdd">
      <text style="margin-right: 20rpx">添加到我的小程序，下单更方便</text>
      <u-icon name="close" color="#fffff" size="18"></u-icon>
    </view>
  </view>
  <!-- #endif -->
  <!-- 通知公告 -->
  <up-popup :show="isShowNotice" mode="center" :round="10" @close="closeNotice">
    <view class="notice">
      <view class="notice_box">
        <image class="bg_img" :src="BaseImgUrl + '/images/notice_bg.png'" mode="aspectFill"></image>
        <image class="close_img" :src="BaseImgUrl + '/images/notic_close.png'" @click="closeNotice"></image>
        <scroll-view scroll-y="true" class="notice_content">
          <u-parse :content="noticeItem || noticeData[0]?.contents"></u-parse>
        </scroll-view>
      </view>
    </view>
  </up-popup>
  <!-- 红包 -->
  <up-popup :show="isShowRedBag" mode="center" :round="23" @close="isShowRedBag = false" :safeAreaInsetBottom="false">
    <view class="HongBaoshow">
      <view class="close" @click="isShowRedBag = false" style="padding: 5rpx;z-index: 99999">
        <u-icon @click="isShowRedBag = false" name="close" color="#fff" size="20"></u-icon>
      </view>
      <view class="tc_bg_box">
        <cache-image :img-src="BaseImgUrl + '/images/Maskgroup.png'"
                     height="300rpx" width="100%"/>
        <!--        <image class="hb_bg" :src="BaseImgUrl + '/images/Maskgroup.png'" mode="aspectFill"></image>-->
        <view class="wenan">
          <view>恭喜获得惊喜红包</view>
          <view>外卖红包天天领，下单更优惠！</view>
        </view>
      </view>
      <view class="pingtai_box">
        <view class="pt_itme1" style="position: relative" v-for="(hongbao,index) in reward?.popup" :key="index"
              @click="toRedPage(hongbao)">
          <image class="pt_icon" :src="hongbao.image"></image>
          <view class="pt_info">
            <view>{{ hongbao.name }}</view>
            <view>{{ hongbao.platform }}</view>
          </view>
          <image class="qiang_btn" :src="BaseImgUrl + '/images/qiang_icon.png'"></image>
          <!-- #ifdef H5 -->
          <wx-open-launch-weapp id="launch-btn" @launch="handleLaunch" @error="handleError"
                                :username="hongbao.original_id"
                                :path="hongbao.path"
                                style="position: absolute;z-index: 2;left: 0;width: 100%;height:100%;opacity: 0.01;background-color: #ff531a">
            <component :is="'script'" type='text/wxtag-template' style="display: block;">
              <div style="position: absolute;top: 0; left: 0; width: 100%;height: 100% ; opacity: 0"></div>
            </component>
          </wx-open-launch-weapp>
          <!-- #endif -->
        </view>
      </view>
    </view>
  </up-popup>
  <!-- 分享活动弹窗v-if="popupData.list[0].title == '分享2'" -->
  <up-popup
      :show="isShowPopup"
      mode="center" :round="20"
      :closeable="false"
      :safeAreaInsetBottom="false"
      :closeOnClickOverlay="false"
      customStyle="width:70%;background:none;">
    <view class="share_box" style="width: 100%;position: relative;">
      <image @click="popupClick(popupData)" class="share_img" :src="popupData.image" mode="widthFix" style="width: 100%"></image>
      <view style="width: 60rpx;height: 60rpx; position: absolute;bottom: -80rpx;z-index: 10;left: 0;right: 0;margin: 0 auto;">
        <up-icon name="close-circle" size="30" color="#f5f5f5" @click="popupClose" ></up-icon>
      </view>
    </view>
  </up-popup>

  <!-- 大活动弹窗提示 -->
  <up-popup
      :show="isShowBigActivity"
      mode="center" :round="10"
      :closeable="true"
      :safeAreaInsetBottom="false"
      @close="isShowBigActivity = false"
      customStyle="width:80%;background: linear-gradient(94deg,#fd6661,#ffb760);">
    <view class="big_activity" style="padding: 20rpx;">
      <view class="activity_title" style="padding: 30rpx; text-align: center;color: #FFFFFF;font-size: 40rpx;">
        团长邀请季
      </view>
      <view style="background: #FFFFFF;border-radius: 20rpx;padding: 20rpx;">
        <view style="padding: 20rpx 0;line-height: 50rpx;">
          邀请两名有效用户，立即获得
          <text style="color: #FF3E00">21元</text>
          ，邀请越多奖励越多
        </view>
        <view @click="toActivity" style="width: 100%;height:88rpx;line-height:88rpx;font-size: 32rpx;font-weight: bold;color: #FFFFFF;text-align: center;border-radius: 100rpx; background: linear-gradient(283deg,#fecc32,#fc754a);">
          去邀请
        </view>
      </view>
    </view>
  </up-popup>
  <!--新手引导-->
  <up-popup
      :show="isShowNewUser"
      mode="center"
      :safeAreaInsetBottom="false"

      bgColor="transparent"
      customStyle="width:80%;">
    <view class="new_user_box">
      <swiper :current="currentStep" @change="swiperChange" style="min-height: 520rpx;width: 100%;">
        <swiper-item v-for="(step, index) in stepData" :key="index" style="height: 100%">
          <view class="new_user_img">
            <view v-if="currentStep+1 === stepData.length" class="new_user_finger" style="left: 46%;bottom: -16rpx;"><image :src="BaseImgUrl + '/home/newUser/new_user_finger.png'" mode="widthFix" style="width: 72rpx;height: 72rpx;"></image></view>
            <view v-else-if="currentStep+1 !== 1" class="new_user_finger" style="bottom: -16rpx;"><image :src="BaseImgUrl + '/home/newUser/new_user_finger.png'" mode="widthFix" style="width: 72rpx;height: 72rpx;"></image></view>
            <view v-else class="new_user_finger"><image :src="BaseImgUrl + '/home/newUser/new_user_finger.png'" mode="widthFix" style="width: 72rpx;height: 72rpx;"></image></view>
            <image :src="BaseImgUrl + step.img" mode="widthFix" style="width: 460rpx;height: 260rpx"></image>
          </view>
          <view class="new_user_line"></view>
          <view class="new_user_sjx"></view>
          <view class="new_user_desc">
            <view class="new_user_desc_t">{{step.title}}</view>
            <view class="new_user_desc_s">
              <view v-for="(desc, index) in step.desc" :key="index">{{desc}}</view>
            </view>
          </view>
          <view v-if="currentStep+1 === stepData.length" @tap="goToSignUpFun" class="new_user_btn">马上去报名</view>
          <view v-else @tap="nextStepFun" class="new_user_btn">下一步（{{currentStep+1}}/{{stepData.length}}）</view>
          <view @tap="goToSignUpFun" class="new_user_skip">跳过引导</view>
        </swiper-item>
      </swiper>

    </view>
  </up-popup>
  <!-- 绑定美团手机号弹窗 -->
  <up-popup :show="bangdingShow" mode="center" :safeAreaInsetBottom="false" round="10">
    <view class="wm_box">
      <view class="content_boxs">
        <view class="know_t">关联美团手机号</view>
        <view class="desc_text">
          请填写
          <text style="color: #FF3E00">美团登录账号绑定的手机号码，</text>
          用于核对美团 订单信息，填写错误将无法获得美团订单返利，无法访问官返商家列表。
        </view>
        <view class="input_name">
          <up-input border="none"
                    class="inputWidth"
                    type="number"
                    clearable
                    :customStyle="{background:'#F6F6F6','border-radius': 0,padding:'10rpx 20rpx'}"
                    placeholder="请输入手机号" v-model="tel"/>
        </view>
        <view class="tip">
          绑定成功后，您可以前往我的-设置-美团授权手机号 进行修改。
        </view>
        <view class="btns_con">
          <view style="flex: 1"></view>
          <!--          <button class="zbbm" @click="closePop">暂不绑定</button>-->
          <button class="submit" @click="submitTel">确认绑定</button>
        </view>
      </view>
    </view>
  </up-popup>
  <!-- 弹出更新提示框 -->
  <up-popup :show="showUpdate" mode="center" :round="10" width="80%" :closeable="false">
    <view
        style="background-color: #FFFFFF;width: 100%;height: 360rpx;border-radius: 20rpx;text-align: center;display: flex;flex-direction:column;align-items: center">
      <text style="color: #FAFAFA;font-size: 36rpx;padding-right: 300rpx" @click="showUpdate = false">X</text>
      <text style="color: black;font-size: 36rpx;padding: 100rpx 120rpx">系统版本过低，请更新</text>
      <text style="color: black;font-size: 36rpx;"></text>
    </view>
  </up-popup>
  <!--  <image src="https://lsz.lszbg.com/imgs/gif/立即抽奖.gif" id="position_view"></image>-->
  <!--  <XtxService :isHome="true"></XtxService>-->
  <!-- 客服教程 -->
  <XtxDragButton :showService="true" :showNewUser="true" bottom="300"/>
  <!--<view class="server_box" v-if="menuList.length>0">
    <view @click="openService" class="help">
      <image :src="BaseImgUrl + '/home/pz/kefu.png'" mode="widthFix" style="height:33rpx;width:33rpx"></image>
      <view style="color: #323232;font-size: 18rpx;">客服</view>
    </view>
    <view style="height: 10rpx"></view>
    <view
        @click="toNewUser" class="help">
      <image :src="BaseImgUrl + '/home/pz/new_user.png'" mode="widthFix" style="height:33rpx;width:33rpx"></image>
      <view style="color: #323232;font-size: 18rpx;">教程</view>
    </view>
  </view>-->
  <!--首页待提交订单号 autoplay -->
  <view v-if="orderList.length>0" class="toBeSubmit">
    <view class="toBeSubmit_box">
      <swiper class="swiper" :autoplay="true" interval="5000" vertical="true" circular="true">
        <swiper-item v-for="(item, index) in orderList" :key="index" @tap="goToOrderCheckFun(item)" class="swiper_item">
          <view class="swiper_content">
            <view v-if="item.picture" class="toBeSubmit_img"><image :src="item.picture" mode="widthFix" style="height:60rpx;width:60rpx"></image></view>
            <view v-else class="toBeSubmit_img"><image :src="item.shop.logo" mode="widthFix" style="height:60rpx;width:60rpx"></image></view>
            <view class="toBeSubmit_content">
              <view v-if="item.status === 0 && item.is_cancel === 0 && item.check_status === 0" class="toBeSubmit_text">提交单号</view>
              <view v-if="item.status === 0 && item.is_cancel === 0 && item.check_status === 3" class="toBeSubmit_text">上传凭证</view>
              <view v-if="item.status === 0 && item.is_cancel === 0 && item.check_status === 4" class="toBeSubmit_text">上传凭证</view>
              <view v-if="item.status === 2 && item.is_cancel === 0 && item.check_status === 3" class="toBeSubmit_text">修改凭证</view>
              <view v-if="item.code == 3" class="toBeSubmit_text">去下单</view>
              <view v-if="item.code == 4" class="toBeSubmit_text">去评价</view>
              <view class="toBeSubmit_time">
                <lszbg-uni-count-down
                    :timeItem="item.end_time"
                    :is-day="false"
                    :is-hour="true"
                    :is-minute="true"
                    :timeStyle="{fontSize: 12,color: '#ffffff',splitorColor: '#ffffff'}">
                </lszbg-uni-count-down>
              </view>
            </view>
          </view>
          <view class="toBeSubmit_icon"><u-icon name="arrow-right" size="14" color="#FFFFFF"></u-icon></view>
        </swiper-item>
      </swiper>

    </view>
  </view>
  <!-- #ifdef APP-PLUS -->
  <!-- 权限说明 -->
  <view style="position: absolute;right: 20rpx;left: 20rpx;top:36px;background-color: #fcf2e8;
        padding: 20rpx;border-radius: 20rpx;font-size: 28rpx;box-shadow:0 2rpx 6rpx #dd524d66 "
        v-if="showPermission">
    <view style="font-weight: bold;letter-spacing: 6rpx;color: #eb8925">权限说明</view>
    <view style="height: 10rpx"></view>
    <view style="letter-spacing: 6rpx;line-height: 38rpx;color: #eb8925;">
      为了展示附近门店，需要您授权访问定位权限，您如果拒绝开启，将无法正常使用APP功能。
    </view>
  </view>
  <!-- #endif -->
</template>
<style lang="scss">
page {
  background-color: #F6F6F6;
}
.content {
  width: 100%;
  position: relative;
}
#top_content{
  margin-bottom: 20rpx;
}
/* 客服、教程css */
.server_box {
  position: fixed;
  right: 10rpx;
  /* #ifdef MP || APP-PLUS */
  bottom: 26%;
  /* #endif */
  /* #ifdef H5 */
  bottom: 30%;
  /* #endif */
  z-index: 100;
  border-radius: 50%;

  .icon {
    width: 38rpx;
    height: 38rpx;
  }

  .text {
    font-size: 20rpx;
    color: #333;
  }
}
/* 首页待提交订单号css */
.toBeSubmit{
  width: 210rpx;
  height: 80rpx;
  position: fixed;
  right: 0;
  top: 40%;
  z-index: 100;
  border-radius: 50%;
  .toBeSubmit_box{
    height: 64rpx;
    padding: 6rpx;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50rpx;
    .swiper_item{
      display: flex;
      align-items: center;
      justify-content: space-between;
      .swiper_content{
        display: flex;
        .toBeSubmit_img{
          width: 56rpx;
          height: 56rpx;
          border: 4rpx solid #FFFFFF;
          border-radius: 50%;
          overflow: hidden;
        }
        .toBeSubmit_text{
          line-height: 32rpx;
          font-size: 22rpx;
          color: #FFFFFF;
          text-align: center;
        }
        .toBeSubmit_time{
          & .uni-countdown{
            & .uni-countdown__splitor{margin: 0!important;}
          }

        }
      }
      .toBeSubmit_icon{
        width: 28rpx;
        height: 28rpx;
      }
    }
  }
}
.help {
  min-height: 70rpx;
  min-width: 70rpx;
  background-color: #fdfdfd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3rpx 6rpx rgba(0, 0, 0, 0.3);
  border-radius: 100rpx;
}

.home_bg {
  background-image: linear-gradient(180deg, #FFFFFF, #F6F6F6);
}

.bar-bg {
  background-size: cover;
}

.bg_banner {
  z-index: 100;
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
}

.barContentAll {
  z-index: 99;
  width: 100%;
  top: 0;
  //background-image: url("https://lsz.lszbg.com/public/uploads/banner/_c0cb2f4e4ad86bd1f206de8d806f2243.png");
  background-size: cover;
}

.barContent {
  position: fixed;
}


.null_text {
  font-size: 26rpx;
  color: #b4b4b4;
  text-align: center;
  box-sizing: border-box;
  padding: 40rpx 0;
}

.Top_wrap {
  position: relative;
  height: 600rpx;
  width: 100%;
  overflow: hidden;
  // #ifdef H5
  margin-bottom: -78rpx;
  // #endif

  .My_top {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1;

    .banner_img {
      width: 100%;
      height: 100%;

      cache-image image {
        width: 100%;
        height: 110%;
      }
    }
  }

  .My_top1 {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    // #ifdef H5
    margin-top: -78rpx;
    // #endif

    .banner_img {
      width: 100%;
      height: 100%;
      position: relative;
      .banner_content{
        position: absolute;
        bottom: 110rpx;
        left: 0;
        z-index: 1;
        width: 100%;
        padding: 20rpx 20rpx;
        box-sizing: border-box;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
      }
      image {
        width: 100%;
        height: 100%;
      }
    }
  }
}


/* homeTopOne css */
.homeTopOne {
  background: linear-gradient( 180deg, #FFFFFF 30%, rgba(255,255,255,0) 50%);
  border-radius: 32rpx 32rpx 0rpx 0rpx;
  margin-top: -80rpx;
  position: relative;
  z-index: 1;
  padding: 30rpx 0 0;
  /* homeTopOne_border */
  .homeTopOne_border{
    border-radius: 28rpx 28rpx 0 0;
    background: rgba(255,255,255,0.5);
    position: absolute;
    top: -10rpx;
    left: 0;
    right: 0;
    z-index: 1;
    width: 100%;
    height: 50rpx;
  }
}
.nav_meu_wrap {
  border-radius: 20rpx;
  padding: 0 20rpx;
  box-sizing: border-box;
  width: 100%;
  height: 286rpx;
  .nav_title {
    display: flex;
    align-items: center;
    padding-left: 26rpx;
    justify-content: space-between;
    margin: 0 auto;

    .nav_title_item {
      flex: 1;
      text-align: center;
      position: relative;
      height: 100rpx;
      display: flex;
      align-items: center;
      justify-content: center;

      .m_title_name {
        word-break: break-all;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 28rpx;
      }

      image {
        width: 50rpx;
        height: 20rpx;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 auto;
      }
    }
  }

  .sssswiper {
    height: 136rpx;

    image {
      width: 86rpx;
      height: 86rpx;
      margin: auto;
    }

    .grid-text {
      font-size: 24rpx;
      //margin-top: 10rpx;
    }
  }
  /* nav_menu_wrap_box */
  .nav_menu_wrap_box{
    display: flex;
    margin-bottom: 30rpx;
    .nav_menu_item{
      width: 20%;
      text-align: center;
      position: relative;
      .nav_menu_item_text{
        font-size: 24rpx;
        color: #333333;
      }
    }
  }
  .nav_menu_wrap_box:last-child{
    margin-bottom: 0;
  }
}
/* 品质专区css */
.pmeg_box{

}
.TongZhi_wrap {
  background-color: #ffffff;
  padding: 0 10rpx;
  border-radius: 20rpx;
  width: 93%;
  margin: 20rpx auto 0;

  .TongZhi_item {
    display: flex;
    align-items: center;

    image {
      width: 128rpx;
      height: 58rpx;
    }

    .tz_wenan {
      word-break: break-all;
      display: -webkit-box;
      font-size: 22rpx;
      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;
      overflow: hidden;
      flex: 1;
    }

    .ta_right_icon {
      border-radius: 300rpx;
      background-color: #EFEFEF;
      width: 43rpx;
      height: 43rpx;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}

.notice_box {
  position: relative;
}

.notice_box .bg_img {
  width: 100%;
  height: 800rpx;
  vertical-align: bottom;
  border-radius: 20rpx;
}

.notice_box .close_img {
  width: 50rpx;
  height: 50rpx;
  position: absolute;
  right: 30rpx;
  top: 40rpx;
  z-index: 9;
}

.notice_box .notice_content {
  width: 100%;
  height: 80%;
  position: absolute;
  left: 0;
  top: 130rpx;
  box-sizing: border-box;
  padding: 40rpx;
}

.notice {
  margin-top: -380rpx;
  width: 580rpx;
  height: 380rpx;
}

.nav_box {
  display: flex;
  align-items: center;
  margin: 0 10rpx 0 20rpx;
  // #ifdef MP
  padding-top: 10rpx;
  height: 80rpx;
  // #endif
  // #ifdef H5 || APP-PLUS
  padding-top: 0;
  height: 68rpx;
  // #endif
  flex: 1;

  .left_box {
    z-index: 88;

    image {
      width: 68rpx;
      margin-bottom: 10rpx;
    }
  }



  .right_box {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 10rpx;

    image {
      width: 64rpx;
    }

    .tixing {
      width: 10rpx;
      height: 10rpx;
      border-radius: 200rpx;
      background-color: #F00;
      position: absolute;
      right: 10rpx;
      top: 10rpx;
    }
    .tixing_box{
      width: 40rpx;
      height: 28rpx;
      line-height: 28rpx;
      text-align: center;
      font-size: 22rpx;
      color: #FFFFFF;
      background: #FA4F4C;
      border-radius: 50rpx;
      position: absolute;
      right: 0rpx;
      top: -16rpx;
      // animation: fadeInOut 5s infinite;
    }
    @keyframes fadeInOut {
      30%, 70% { opacity: 1; } /* 完全透明 */
      50% { opacity: 0; } /* 完全不透明 */
    }
  }
}
/* 搜索公用css */
.sousuo_box {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  width: 320rpx;
  height: 68rpx;
  .input_box {
    border-radius: 200rpx;
    width: 100%;
    height: 48rpx;
    line-height: 48rpx;
    background-color: #FFFFFF;
    padding: 10rpx 26rpx;
    color: #9B9B9B;
    font-size: 26rpx;
    display: flex;
    align-items: center;
  }

  .sousuo_btn {
    background: linear-gradient( 270deg, #FF7F14 0%, #FF5429 100%);
    border-radius: 200rpx;
    color: #FFFFFF;
    position: absolute;
    right: 6rpx;
    width: 120rpx;
    height: 56rpx;
    line-height: 56rpx;
    font-size: 28rpx;
    text-align: center;
  }
}
/* 列表内容css */
.content_list{
  position: relative;
  .home_shop_box{
    padding: 0 20rpx;
    .shops_list{
      background: #FFFFFF;
      border-radius: 20rpx;
      margin: 20rpx 0;
    }
  }

}


/* 主题内容背景 */
.theme_content_bg{
  width: 100%;
  height: 650rpx;
  background: linear-gradient( 180deg, #FFFFFF 10%, rgba(255,255,255,0) 100%);
  border-radius: 32rpx 32rpx 0rpx 0rpx;
  position: absolute;
  top: 0;
  z-index: 1;
}
/* 筛选css */
.sortMd{
  width: 100%;
  height: 324rpx;
  position: sticky;
  z-index: 100
}
.sortMd_active{
  height: 324rpx;
  border-radius: 0;
  box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0,0,0,0.1);
  background: #FFFFFF;
}
/*抢红包弹窗样式*/
.HongBaoshow {
  width: 580rpx;
  position: relative;

  .close {
    position: absolute;
    right: 26rpx;
    top: 22rpx;
    z-index: 100;
  }

  .tc_bg_box {
    position: relative;

    .hb_bg {
      border-radius: 10px;
      width: 100%;
      height: 300rpx;
    }

    .wenan {
      position: absolute;
      z-index: 999;
      top: 0;
      padding: 46rpx;
      color: #fff;

      view:nth-child(1) {
        font-weight: bold;
        font-size: 44rpx;
      }

      view:nth-child(2) {
        margin-top: 10rpx;
      }
    }
  }

  .pingtai_box {
    padding: 10rpx 30rpx 0 30rpx;

    .pt_itme1 {
      display: flex;
      align-items: center;
      background-color: #FEF9E9;
      padding: 20rpx 30rpx;
      border-radius: 20rpx;
      margin: 30rpx 0 38rpx 0;

      .pt_icon {
        width: 100rpx;
        height: 100rpx;
      }

      .pt_info {
        padding-left: 25rpx;
        flex: 1;

        view:nth-child(1) {
          font-size: 34rpx;
          font-weight: bold;
        }

        view:nth-child(2) {
          color: #999999;
          font-size: 24rpx;
          word-break: break-all;
          display: -webkit-box;
          -webkit-line-clamp: 1;
          -webkit-box-orient: vertical;
          overflow: hidden;
        }
      }

      .qiang_btn {
        width: 100rpx;
        height: 100rpx;
        margin-left: auto;
      }
    }
  }
}

.dangqian_dizhi {
  /* #ifdef MP-WEIXIN */
  // margin: 22rpx 0 10rpx 20rpx;
  /* #endif */
  // #ifdef H5 || APP-PLUS
  // margin: 10rpx 0 5rpx 20rpx;
  // #endif
  padding: 0 0;
  display: flex;
  justify-content: space-between;
  height: 80rpx;
  align-items: center;
  .dangqian_dizhi_left {
    max-width: 330rpx;
    height: 80rpx;
    line-height: 80rpx;
    display: flex;
    padding-left: 20rpx;
  }
  .dangqian_dizhi_right {
    flex: 1;
    height: 50rpx;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  view:nth-child(1) {
    position: relative;
  }

  image {
    width: 33rpx;
    height: 36rpx;
    margin-right: 3rpx;
  }

  .cityName {
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 28rpx;
    z-index: 88;
    color: #FFFFFF;
  }

  .cityName1 {
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 28rpx;
    z-index: 88;
    color: #666666;
  }

}

.topTip {
  position: fixed;
  top: 58rpx;
  right: 68rpx;
  z-index: 999;

  .icons {
    display: flex;
    justify-content: flex-end;
    margin-right: 56rpx;
  }
}

.tipAdd {
  border-radius: 10rpx;
  background-color: #000000;
  color: white;
  text-align: center;
  font-size: 26rpx;
  padding: 10rpx 20rpx;
  display: flex;
}

.wm_box {
  position: relative;
  width: 600rpx;
  background: #ffffff;
  border-radius: 32.5rpx;
}

.content_boxs {
  box-sizing: border-box;
  position: relative;

  .know_t {
    font-size: 32rpx;
    color: #000;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
    margin-top: 6rpx;
    padding: 20rpx;
    border-bottom: 1px solid #eee;
  }

  .desc_text {
    font-size: 22rpx;
    line-height: 36rpx;
    padding: 20rpx 30rpx 0;
  }

  .tip {
    color: #BFBFBF;
    font-size: 22rpx;
    line-height: 36rpx;
    margin: 0 30rpx;
  }

  .input_name {
    margin: 20rpx 30rpx;
  }

  .btns_box {
    width: 280rpx;
    height: 64rpx;
    background: linear-gradient(270deg, #FEB85A 0%, #FC754A 100%);
    border-radius: 50rpx;
    font-size: 28rpx;
    color: #fff;
    line-height: 64rpx;
    text-align: center;
  }

  .btns_con {
    display: flex;
    justify-content: flex-end;
    font-size: 26rpx;
    margin: 20rpx 30rpx 30rpx;

    button {
      margin-left: 30rpx;
      font-size: 24rpx;
    }

    .zbbm {
      border-radius: 200rpx;
      width: 176rpx;
      background-color: #FFFFFF;
      border: #DDDDDD 1rpx solid;
      color: #999999;
    }

    .submit {
      border-radius: 200rpx;
      width: 176rpx;
      background: linear-gradient(131deg, #FC754A 0%, #FC754A 0%, #FEB95A 100%);
      color: #FFFFFF;
    }
  }
}



.noData_box {
  margin-top: -30rpx;
  text-align: center;
  color: white;


  image {
    width: 268rpx;
    height: 268rpx;
  }

  .lijipay {
    position: relative;
    margin: 20rpx auto 68rpx;

    .get_p {
      background: linear-gradient(131deg, #FC754A 0%, #FC754A 0%, #FEB95A 100%);
      padding: 10rpx 38rpx;
      border-radius: 200rpx;
    }
  }
}

#position_view {
  width: 120rpx;
  height: 130rpx;
  position: absolute;
  right: 10rpx;
  bottom: 28%;
  opacity: 1;
}
/* 新手引导弹窗css */
.new_user_box{
  width: 100%;
  height: 820rpx;

  .new_user_img{
    width: 460rpx;
    height: 260rpx;
    position: relative;
    .new_user_finger{
      width: 72rpx;
      height: 72rpx;
      position: absolute;
      right: 20rpx;
      bottom: 20rpx;
    }
  }
  .new_user_line{
    width: 4rpx;
    height: 92rpx;
    margin-left: 100rpx;
    background: linear-gradient( 180deg, #FFFFFF 0%, rgba(255,255,255,0.3) 100%);
  }
  .new_user_sjx{
    width: 0;
    height: 0;
    margin-left: 84rpx;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 14px solid #FF5429;
  }
  .new_user_desc{
    padding: 30rpx;
    line-height: 50rpx;
    color: #FFFFFF;
    margin-top: -2rpx;
    background: linear-gradient( 96deg, #FF5429 0%, #FF8B2B 100%);
    border-radius: 30rpx;
    .new_user_desc_t{
      font-size: 28rpx;
    }
    .new_user_desc_s{
      font-size: 26rpx;
    }
  }
  .new_user_btn{
    width: 260rpx;
    height: 80rpx;
    line-height: 80rpx;
    text-align: center;
    margin: 20rpx auto;
    color: #FFFFFF;
    background: rgba(0,0,0,0.15);
    border-radius: 50rpx;
    border: 2rpx solid rgba(253,253,253,0.3);
  }
  .new_user_skip{
    width: 100rpx;
    height: 80rpx;
    line-height: 80rpx;
    text-align: center;
    font-size: 24rpx;
    color: #E1E1E1;
    margin: 20rpx auto;
  }
}

</style>


